Re: Creating a new folder
Re: Creating a new folder
- Subject: Re: Creating a new folder
- From: Michelle Steiner <email@hidden>
- Date: Sun, 9 May 2004 21:23:00 -0700
On May 9, 2004, at 9:03 PM, Carl Anderson wrote:
set PartA to path to desktop
set PartA to PartA & "Test:"
display dialog PartA as text
tell application "Finder"
set myNewFolder to make new folder at PartA with properties
{name:"Temp"}
end tell
The problem is that PartA is an alias, not a string. So, PartA & "Test"
results in a list, {alias "Dora:Users:michelle:Desktop:", "Test:"}.
When you display dialog, Applescript coerces that list into a string,
in order to display the text you asked it to disply.
So, when you try to make the new folder, the script first makes a new
folder at the first element of the list, which is the desktop; then it
tries to make another folder at "Test" but because that is a string,
you get an error.
To fix the problem, change the first line to
set PartA to (path to desktop) as text
-- Michelle
--
You can not change the world without perforce changing yourself.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.