• 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: Getting the full path of an applescript application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the full path of an applescript application


  • Subject: Re: Getting the full path of an applescript application
  • From: "Mark J. Reed" <email@hidden>
  • Date: Tue, 10 May 2005 13:53:25 -0400

Well, launching an X app without an absolute path is easy if it happens to live in a directory that's in the default $PATH.  Otherwise, there's simply no way without knowing the absolute path - or at least a set of possible absolute paths which you can add to both path variables as part of your script.

If you have things set up so that you can launch the app from a Terminal window without the full path (by setting $PATH and $DYLD_LIBRARY_PATH in your .bash_profile), then you can easily get access to that same functionality from AppleScript:

do shell script ". \"$HOME/.bash_profile\"; myapp </dev/null >/dev/null 2>&1 &"

On 5/10/05, Charles Earl <email@hidden> wrote:
Hi,
This seems to have been indirectly discussed in previous posts.
I'm trying to launch an X11 application using applescript.
The X11 applicaiton has some library dependencies and I need to set
DYLD_LIBRARY_PATH
to include directories that in the distribution before launching the X11
application.

My question
Is there a way to launch the application WITHOUT REFERRING TO ABSOLUTE
PATHS?

It seems to be the case that there's no way around having to use
absolute paths in starting an applescript application.

If I understand previous discussions, there's no applescript variable
that stores the path to the directory in which the application file is
contained.
It is only possible to obtain the default directory ("/") of the Finder.

To be specific the script:

tell application "Finder"
    launch application "X11"
end tell

do shell_script "export DISPLAY=:0;export
DYLD_LIBRARY_PATH=/Applications/MyApp/syslibs;/Applications/MyApp/myapp &"

works if the application is located in /Applications/MyApp

Is there a way to remove the absolute path dependence?

Do let me know if there are some workarounds

--
____________________________________________________________________
Charles C Earl, Ph.D.                         email@hidden
Stottler Henke Associates, Inc.         http://www.stottlerhenke.com
951 Mariner's Island Blvd.,Suite 360   Main Telephone (650) 931-2700
San Mateo, CA 94404                     (Voice & FAX) (770) 969-3774
____________________________________________________________________

_______________________________________________
Do not post admin requests to the list. They will be ignored. email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Getting the full path of an applescript application (From: Charles Earl <email@hidden>)

  • Prev by Date: Re: System Events Info
  • Next by Date: Compiled script and high CPU %
  • Previous by thread: Getting the full path of an applescript application
  • Next by thread: Compiled script and high CPU %
  • Index(es):
    • Date
    • Thread