• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Folders within folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folders within folders


  • Subject: Re: Folders within folders
  • From: Dave Lyons <email@hidden>
  • Date: Wed, 19 Oct 2005 18:17:26 -0700

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


  • Follow-Ups:
    • Re: Folders within folders
      • From: Louis Genovese <email@hidden>
References: 
 >Folders within folders (From: Louis Genovese <email@hidden>)
 >Re: Folders within folders (From: Dave Lyons <email@hidden>)
 >Re: Folders within folders (From: Louis Genovese <email@hidden>)

  • Prev by Date: Re: Folders within folders
  • Next by Date: Re: coercing text to time
  • Previous by thread: Re: Folders within folders
  • Next by thread: Re: Folders within folders
  • Index(es):
    • Date
    • Thread