Jump to content
Sign in to follow this  
sbrady

make a folder on the desktop

Recommended Posts

sbrady

can someone please help me code these needs.

1. create a dialog box that asks for a name

2. get the name entered in #1

3. make a folder on the desktop with the name given in #2 above

4. move the folder icon from #3 to a pre-determined location (ie 100,200) ......meaning 100 pixles from the left side, 200 pixels down from the top

Share this post


Link to post
Share on other sites
water

With "3. make a folder on the desktop" you mean a shortcut to a folder in the filesystem?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

I need a real folder created on the desktop NOT a shortcut. thanks

Share this post


Link to post
Share on other sites
water

DirCreate(@DesktopDir & "test")
creates a folder named "test" on the desktop.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

thanks......what about the message box the asks for a name to be entered, then THAT name or text or string is what gets used to name the desktop folder.

Share this post


Link to post
Share on other sites
water

That should be easy to be found and coded by you (hint: InputBox).

What's harder to do is to position the folder on the desktop.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

I am coming from Apple and Applescript.........granted 10 years of it but AutoIT on PC is so hard for me.

Share this post


Link to post
Share on other sites
water

Does this mean your dog ate the help file ;)

Press F1 in SciTe and search for InputBox


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

thanks again........I mean absolutely no harm by these words but its easier to get what I need from Applescript and its support community. I just need to convert 80 Applescripts to AutoIT and I can see its going to be a long hard row to hoe.

Share this post


Link to post
Share on other sites
water

I don't know Applescript but using InputBox to get the input of a user is no brain surgery at all.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
caleb41610

$text = InputBox( "Folder", "Type the folder name" )
DirCreate( @DesktopDir & "" & $text )

I suggest browsing the Example section of the forum. Find a script that interests you. (preferably one commented a lot)

Run it, then read the entire script and figure out which part does what. That's a super-quick way to get a head start. That's what I did.

After that, browse the help file. It's insanely detailed.

Edited by caleb41610
  • Like 1

Share this post


Link to post
Share on other sites
sbrady

thanks a ton Caleb

Share this post


Link to post
Share on other sites
water

Do some error checking so the script doesn't create an empty folder when the user cancels the input

$text = InputBox( "Folder", "Type the folder name" )
If @error <> 0 Then Exit
DirCreate(@DesktopDir & "\" & $text )


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

OK the Applescript way gets the same result but the code is way different........so I'll have to get used to this new and different way. thanks.

Share this post


Link to post
Share on other sites
water

And to make it look more beautiful (important for Apple users ;) ) set the height of the control:

$text = InputBox( "Folder", "Type the folder name", "", "", Default, 130)
If @error <> 0 Then Exit
DirCreate(@DesktopDir & "" & $text)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

I've found some code to move the icon on the desktop - unfortunately it doesn't work

#AutoIt3Wrapper_UseX64=y
#include <GuiListView.au3>
$text = InputBox("Folder", "Type the folder name", "", "", Default, 130)
If @error <> 0 Then Exit
DirCreate(@DesktopDir & "" & $text)
Global $hwnd = ControlGetHandle("[CLASS:Progman]", "", "SysListView321")
$i = ControlListView("", "", $hwnd, "FindItem", $text)
If $i < 0 Then Exit MsgBox(0, "Error", "Specified icon not found!")
_GUICtrlListView_SetItemPosition($hwnd, $i, 100, 100)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
sbrady

dang it.........other code then........can someone help me copy all "folders" in a master folder to a destination folder.

Share this post


Link to post
Share on other sites
BrewManNH

DirCopy?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
sbrady

OK heres the deal..........there are files and folders in the master folder........I need to copy just the sub folders. In Applescript I would say:

set theFolders to every item in "master folder" whose name contains "Exports"

then I would copy every item in theFolders

..........how do to this in AutoIT.

Share this post


Link to post
Share on other sites
Maarten002

Maybe i misunderstand your question #4, but the position of the icons on you desktop are saved in the registry at this location:

HKEY_CURRENT_USERSoftwareMicrosoftWindowsShellBags1Desktop

ItemPos...(display resolution)

But how to interpreted this info, i don't know...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×