• 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
path to a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

path to a script


  • Subject: path to a script
  • From: Jim Brandt <email@hidden>
  • Date: Thu, 28 Jan 2010 08:02:58 -0600

Is there an accepted way to obtain the folder path that contains a script?

Here's what I'm trying to do.

I want to launch script "a.scpt" using cron - at a certain time of day. Script "a.scpt" needs to run script "b.scpt". a.scpt and b.scpt will always reside in the same folder.

In order to do this currently, I have to hard-code the path of the script "b.scpt". Since both a.scpt and b.scpt reside in the same folder, I would rather obtain the path of the currently running script and use that to run the second script.

This works if the script is saved as an application:
tell application "Finder" to set myFolder to (container of (path to me)) as string

but I want to be able to do the same thing from a script that's not saved as an application. Is this possible?

BTW, if you perform the above line from the script , you get the path to the Script Editor application, not the path of the script itself, which is what I need.

TIA,

Jim
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: path to a script
      • From: Michelle Steiner <email@hidden>
    • Re: path to a script
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Send outgoing message error from Mail.app
  • Next by Date: Re: path to a script
  • Previous by thread: Re: URL Access Scripting file size limitations? (Leopard)
  • Next by thread: Re: path to a script
  • Index(es):
    • Date
    • Thread