Re: Path relative to current script? Re: POSIX file question
Re: Path relative to current script? Re: POSIX file question
- Subject: Re: Path relative to current script? Re: POSIX file question
- From: Michelle Steiner <email@hidden>
- Date: Thu, 23 Oct 2003 23:54:36 -0700
On Thursday, October 23, 2003, at 08:17 PM, Don Briggs wrote:
I'd like to:
launch the test script in Script Editor
determine the path to the script I've just launched
perform a simple operation to change it to the path of my test
document
tell my test app to open its test document.
The first step might look like this:
property pathToThisScript : ""
tell application "Script Editor"
set pathToThisScript to path of front document
end tell
But what next?
This will move the script (assuming that it has been saved; I didn't
put checks into the script to ensure that) to the folder containing the
test document.
set test_document to choose file
tell application "Script Editor"
set this_script to (path of front document as POSIX file) as alias
end tell
tell application "Finder"
set the containing_folder to the folder of the test_document
move this_script to the containing_folder
end tell
--Michelle
--
Support our troops. Bring them home NOW!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.