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

Re: path to a script


  • Subject: Re: path to a script
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 28 Jan 2010 08:20:43 -0600

On Jan 28, 2010, at 8:02 AM, Jim Brandt wrote:
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.

A suggestion.
Write a script and save it as an application bundle. I will call this application "A.app".
Put "a.scpt" and "b.scpt" into the /Contents/Resources/ folder in the bundle of "A.app".
When cron launches "A.app", "A.app" loads "a.scpt" and "b.scpt" and runs "a.scpt" or one of its handlers.
"a.scpt" and "b.scpt" can call each other, or whatever they need to do, without knowing where the script files are located. Only "A.app" needs to know the location of the script files, which are internal and can't get lost.

I've done this and it works, but I've never used cron, so I don't know if it's compatible with launching applications.

 _______________________________________________
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

References: 
 >path to a script (From: Jim Brandt <email@hidden>)

  • Prev by Date: path to a script
  • Next by Date: A frustrating problem - Grabbing Notes field from iCal event
  • Previous by thread: path to a script
  • Next by thread: Re: path to a script
  • Index(es):
    • Date
    • Thread