• 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: Determining File Path of Running Script Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining File Path of Running Script Application


  • Subject: Re: Determining File Path of Running Script Application
  • From: Walter Ian Kaye <email@hidden>
  • Date: Thu, 29 Jul 2004 02:32:50 -0700

At 02:12a -0700 07/29/2004, Rick Gordon didst inscribe upon an electronic papyrus:

How can a script application determine its own file path?

For instance, if I wanted to write a script that would do something like this:

do shell script "cd MY_FILEPATH; open ./TARGET_PACKAGE/Contents/MacOS/TARGET_FILE"

....where the intention is to be able to traverse a relative filepath to the target.

I see two possibilities...

If the package is an .app, you can get the path using its creator code or bundle identifier via the Finder.

If it's not an .app, then you could have your shell script write a temporary file to a known location and have the script read that file.

There may be other avenues, depending on the specifics of your needs.


-Walter
_______________________________________________
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: 
 >WAS: Re: I cannot even successfully have the Finder make a folder on the Desktop! (From: Bill Planey <email@hidden>)
 >Re: WAS: Re: I cannot even successfully have the Finder make a folder on the Desktop! (From: Walter Ian Kaye <email@hidden>)
 >Determining File Path of Running Script Application (From: Rick Gordon <email@hidden>)

  • Prev by Date: Determining File Path of Running Script Application
  • Next by Date: Re: Duntdown script (was Non Privileged shutdown (was Privileged shutdown)
  • Previous by thread: Determining File Path of Running Script Application
  • Next by thread: Re: Determining File Path of Running Script Application
  • Index(es):
    • Date
    • Thread