Create new folder on any desktop?

I’d like to create a folder on my desktop but the script is too specific in that it only works on the existing user account. I’d like this very simple script to work on ANY user account. Here’s the code that works, it’s just too specific. I want the program to be able to run on any computer and not just mine.


tell application "Finder"
	activate
	display dialog "Name of new content directory" default answer "" buttons {"Cancel", "OK"} default button 2 with icon 1
	set the name_folder to the text returned of the result
	make new folder at folder "Desktop" of folder "dmn_01" of folder "Users" of startup disk with properties {name:name_folder}
. . .

Thanks,
Layne

‘path to desktop’ will give you the desktop of whatever user is logged in - you could append your folder to create onto that

Thanks. Seeing as how I have about 90 minutes of experience with AppleScript could I ask someone where that code should go? As soon as that’s fixed my first script is done!!!

Again, thanks!

Hi,

You don’t need to use path to since you’re using Finder. Finder has a ‘desktop’ property.

tell app “Finder”
make folder at desktop with properties {name:“somename”}
end tell

gl,

Thanks everyone. My first AS works great! Thanks for your help.

-Layne

Did you know that the Finder assumes, unless you specify, that the folder gets automatically created on the desktop?

Try this:

Have a good one!

Tom

Now I do!

Thanks.

yeah if you type:

tell application "finder"
make new folder
end tell

it will make a new folder on the desktop called untitled folder, untitled folder 1, untitled folder 2, etc.