• 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: Philip Aker <email@hidden>
  • Date: Mon, 2 Feb 2009 20:00:02 -0800

On 2009-02-02, at 18:46:44, Donald Hall wrote:

When used in a compiled script, "path to me" returns the path to the script in Leopard when the script is run by Script Editor. However, when I run the script with a script running application I wrote (an AppleScript application), I get the pre-Leopard result of the path to the application running the script. Is there any simple way of getting the path to the script in this case?

I think you're asking this:

set p2m to POSIX path of (path to me)
set p2a to POSIX path of (path to current application)
if (p2m is equal to p2a) then
set p2r to POSIX path of (path to resource "main.scpt" in directory "Scripts")
display dialog p2r
else
display dialog "path to me is not the same as path to current application"
end if

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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:
    • compare file icons or icon properties
      • From: Pooja <email@hidden>
References: 
 >path to a script (From: Donald Hall <email@hidden>)

  • Prev by Date: path to a script
  • Next by Date: Re: Value of a date in Numbers
  • Previous by thread: path to a script
  • Next by thread: compare file icons or icon properties
  • Index(es):
    • Date
    • Thread