Re: folder exists on the desktop
Re: folder exists on the desktop
- Subject: Re: folder exists on the desktop
- From: Emmanuel <email@hidden>
- Date: Thu, 1 Mar 2001 01:28:09 -0600
At 19:38 -0600 28/02/01, Amrish Raj wrote:
>
>
Hi
>
Can some one help me with an apple script to check to see if a folder exists
>
on the desktop....
----------------------- tested OS 9.0.4
tell application "Finder"
set itExists to exists folder theFolder of desktop
end
-----------------------
>
if it does i need to open a file in that folder....
----------------------- tested OS 9.0.4
if itExists then
tell application "Finder"
open file theFile of folder theFolder of desktop
end
end
-----------------------
>
and
>
rename the file by appending a string to the existing file name...and save
>
the file by creating a new folder on the desktop...
I suppose you mean, duplicating the file to a new folder and changing its name.
----------------------- tested OS 9.0.4
tell application "Finder"
set theOldFile to file theFile of folder theFolder of desktop
set theNewFolder to make new folder at desktop with properties {name:theName}
set theNewFile to (duplicate theOldFile to theNewFolder)
set name of the theNewFile to (name of theNewFile) & theString
end tell
-----------------------
Inputs:
theFolder: name of existing folder
theFile: name of existing file
theName: name for new folder
theString: string to append to name
Add any needed error checking (such as, check new name is < 32 characters)
HTH
Emmanuel