• 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: folder exists on the desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >folder exists on the desktop (From: "Amrish Raj" <email@hidden>)

  • Prev by Date: Re: global variable not being recognized by script object
  • Next by Date: Re: Records
  • Previous by thread: folder exists on the desktop
  • Next by thread: Re: Scripting Additions
  • Index(es):
    • Date
    • Thread