• 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: Path relative to current script? Re: POSIX file question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Path relative to current script? Re: POSIX file question (From: Don Briggs <email@hidden>)

  • Prev by Date: Mail.app word wrap 72 characters
  • Next by Date: Mail question -- should be easy...
  • Previous by thread: Path relative to current script? Re: POSIX file question
  • Next by thread: Need to script tracking in multiple Quark files-correction
  • Index(es):
    • Date
    • Thread