• 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: Help with applescript creating folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with applescript creating folders


  • Subject: Re: Help with applescript creating folders
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 3 Aug 2007 12:28:02 -0400

Oh, and since this is a shell scripting list :), here's how to do it with "do shell script":

property subf_names: { "Design/Stage 1", "Based On", "Artwork" }
--
display dialog "Enter job name:" default answer "job name"
set j_name to text returned of result
repeat
    display dialog "Enter job number:" default answer "0"
    set j_number to text returned of result
    try
        if (j_number as integer) < 100000 and ¬
            (j_number as integer) > -1 then exit repeat
    on error
        display dialog "Error: enter an integer less than 100,000."
    end try
end repeat
set job_number to text -6 thru -1 of ("00000" & j_number & "_")
set temp_name to job_number & j_name

tell application "Finder"
    set main_folder to (make new folder at desktop with properties {name:temp_name}) as alias
end tell

repeat with child in subf_names
do shell script "cd " & quoted form of posix path of main_folder & "; mkdir -p " & quoted form of child
end repeat

--
Mark J. Reed < email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help with applescript creating folders
      • From: Tim Rycroft <email@hidden>
    • Re: Help with applescript creating folders
      • From: Bill Briggs <email@hidden>
References: 
 >Help with applescript creating folders (From: Tim Rycroft <email@hidden>)
 >Re: Help with applescript creating folders (From: Michelle Steiner <email@hidden>)
 >Re: Help with applescript creating folders (From: "Mark J. Reed" <email@hidden>)
 >Re: Help with applescript creating folders (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Help with applescript creating folders
  • Next by Date: Re: Help with find text command
  • Previous by thread: Re: Help with applescript creating folders
  • Next by thread: Re: Help with applescript creating folders
  • Index(es):
    • Date
    • Thread