Referencing a Folder Relatively
Referencing a Folder Relatively
- Subject: Referencing a Folder Relatively
- From: Christopher Jett <email@hidden>
- Date: Mon, 19 Nov 2001 18:55:16 -0600
Scripters,
I've got a Folder Action that I am going to be using in conjunction with
Pixel Pipe on several folders on a webserver to reduce photos to a certain
size. I currently have it setup to save the output into a specific
destination folder.
What I want to do is make the script portable. I want to have the processed
image files saved into a folder named "output" that is at the same level of
the file system as the folder with the Folder Action. In other words, I
want one script that can be reused on several folders. These are going to
be used on several web sites and I want to use one portable AppleScript
instead of several hard coded scripts.
I'm relatively new to AppleScript and I am having trouble wrapping my mind
around how to reference the "output" folder relative to the folder with the
attached action. Each folder with an attached Folder Action will always
have an "output" folder at the same level.
Here is the folder action script currently:
on adding folder items to this_folder after receiving added_items
Process(added_items)
end adding folder items to
on Process(added_items)
tell application "PixelPipe"
-- Set the preference options.
set file format of preferences to "JPEG"
set append extension of preferences to true
set scale of preferences to false
set constrain of preferences to true
set constrain width of preferences to 200
set delete converted of preferences to true
set destFolder to alias "Server HD:photos:output"
convert {added_items} destination destFolder
end tell
end Process
So, how would I reference the "output" folder relative to the folder with
the attached action (they'll always be at the same level of the HD)?
I am on digest, so if someone could cc me directly, I would appreciate it.
--
Christopher Jett | email@hidden
Jett Fuel Productions |
http://www.jettfuel.net
830.798.8723 | 888.403.JETT