Re: Making Folders
Re: Making Folders
- Subject: Re: Making Folders
- From: Steve Suranie <email@hidden>
- Date: Fri, 06 Jan 2006 10:55:12 -0500
- Thread-topic: Making Folders
I did a work around:
on folderMaker(topLevelPath, i)
set topLevelPath to topLevelPath as string
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 folderList to list folder (topLevelPath as alias) without invisibles
if folderList contains thisFolderName then
display dialog "This folder already exists, would you like to select
another name?" buttons {"Yes", "No"} default button "No"
else
set folderPath to topLevelPath & thisFolderName
display dialog "Make folder"
end if
end folderMaker
But I am still annoyed I can't get the exists command to work
On 1/6/06 10:31 AM, "Steve Suranie" <email@hidden> wrote:
> 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
>
_______________________________________________
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