Re: Folders within folders
Re: Folders within folders
- Subject: Re: Folders within folders
- From: Louis Genovese <email@hidden>
- Date: Wed, 19 Oct 2005 21:40:23 -0400
Thanks for your help, Dave.
I'm glad you got something out of it, even if it is a bug.
Lou
On Oct 19, 2005, at 9:17 PM, Dave Lyons wrote:
On Oct 19, 2005, at 5:53 PM, Louis Genovese wrote:
One other issue is that when the first folder is created, it it
not named what I've typed into the dialog, it's named with Kanji
characters. Ever seen this, and can I fix it?
set projectFolder to (choose folder)
tell application "Finder"
set projDir to make new folder at projectFolder with
properties {name:display dialog "Project Name" default answer ""
buttons {"OK", "Cancel"} default button 1}
Hi Louis,
The fix to your script is easy, but you've also uncovered a Finder
bug that I've never seen before.
If you run just the "display dialog" by itself, you'll find it's
not returning the result you're expecting:
display dialog "Project Name" default answer "" buttons {"OK",
"Cancel"} default button 1
--> {text returned:"foo", button returned:"OK"}
This is a "record" with two parts, "text returned" and "button
returned." So you'll need something like this:
set projectFolder to (choose folder)
set choice to display dialog "Project Name" default answer ""
buttons {"OK", "Cancel"} default button 1}
if button returned of choice is "OK" then
set theName to text returned of choice -- the interesting
part
tell application "Finder"
set projDir to make new folder at projectFolder with
properties {name: theName}
end tell
end if
Now, the Finder bug is that it never should have accepted the
record as the name property. I'll file a bug against myself & take
a look at that.
Cheers,
--Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden