On or near 2/21/01 5:51 PM, Andy Fragen at [EMAIL PROTECTED] observed:

> So far I have the following
> 
> on open theFile
>   tell application "Finder"
>       set thePath to (parent of theFile)
>       set newAlias to thePath & ":Before.jpg"
>       make new alias file to selection at file newAlias
>   end tell
> end open
> 
> I keep getting run errors about can't get parent of theFile. I obviously
> have something wrong here but my AppleScript for Dummies isn't helping me.

You want "container" not "parent." Try something like this:

on open theFiles
    tell application "Finder"
        set aFile to item 1 of theFiles
        set thePath to (container of aFile) as string
        set newAlias to thePath & "Before.jpg"
        set newFile to make new alias file to aFile at alias thePath
        set name of newFile to "Before.jpg"
    end tell
end open

-- 
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage:
<http://homepage.mac.com/allenwatson/>


-- 
To unsubscribe:               <mailto:[EMAIL PROTECTED]>
To search the archives: 
          <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to