• 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
Making Folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making Folders


  • Subject: Making Folders
  • From: Steve Suranie <email@hidden>
  • Date: Fri, 06 Jan 2006 10:31:43 -0500
  • Thread-topic: Making Folders

Hi all:

I am trying to write a subroutine that creates folders based on user input.
I'm getting a syntax error when I go to check if the name the user selected
already exists. The error I am getting states:

Expected "," but found identifier

Here's the subroutine:

on folderMaker(topLevelPath, i)
    display dialog "Item" & i & ": Enter the name of the folder you are
creating. Please use the format SKU_DESCRIPTION_MODALITY" default answer
"EXAMPLE: 00001_RedShirt_HI"
    set thisFolderName to text returned of result as string
    set folderPath to topLevelPath & thisFolderName
    (*THIS IS WHERE THE SCRIPT IS BREAKING> ON THE IF STATEMENT BELOW*)
    if not (exists folder thisFolderName of (topLevelPath as alias)) then
        display dialog "Make folder"
    else
        display dialog "This folder already exists, would you like to select
another name?" buttons {"Yes", "No"} default button "No"
    end if
end folderMaker

I've copied this bit of script from another script on the Apple web site:

on adding folder items to this_folder after receiving these_items
tell application "Finder"
if not (exists folder "Done" of this_folder) then
make new folder at this_folder with properties {name:"Done"}
end if...

I can get it to compile if I rewrite it as:

if not (exists thisFolderName of (topLevelPath as alias)) then

but then I get an error message saying

Can't get thisFolderName of alias "ImageDump:Online
_Shop_Originals:2006:HI:HI_apparel:tops:".

Any help would be appreciated

Thanks

Steve

 _______________________________________________
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: Making Folders
      • From: Mark Lively <email@hidden>
    • Re: Making Folders
      • From: Steve Suranie <email@hidden>
References: 
 >Re: Saving Safari documents as html? (From: David Duncan <email@hidden>)

  • Prev by Date: Re: How do I delete the 1st three characters from a variable
  • Next by Date: Re: Making Folders
  • Previous by thread: Re: Saving Safari documents as html?
  • Next by thread: Re: Making Folders
  • Index(es):
    • Date
    • Thread