Re: running an application without a name
Re: running an application without a name
- Subject: Re: running an application without a name
- From: julifos <email@hidden>
- Date: Sat, 29 Mar 2003 13:42:32 +0100
>
thanks very much! My appname is changing, but I take it from a
>
textfield that's filled from a prior browse operation.
>
>
unfortunately, the OS still seems to prompt me for the app when I do this...
>
>
set theApppath to contents of text field "apppath" of tab view item
>
"installTab" of tab view "tabs" of theWindow
>
launch application theApppath
>
>
any further suggestions here?
>
>
will applescript take the new "/" syntax, or do we need to convert to ":"?
>
Hi, Michael!
I don't know what are your text field's contents: if only the app name, you
can (or you *should* can)
launch application "Whatever"
Perhaps is problematic if the app is not still in the user's applications
database, so Finder can't launch such app, because it doesn't know where is
it located...
Anyway, if you "choose file" to fill your text field's contents, your
original result is an alias to the app, whose *path* you can use to launch
the app:
launch application "path:to:application"
Which also does the job.
You can also translate the responsibility to the Finder:
tell application "Finder" to open alias "path:to:application"
On the other hand, if you receive your app's path via drag&drop (the you get
anything such as "/users/whatever/application"), you can convert that UNIX
path to a standard path:
POSIX file "/users/whatever/application" as text
--> "diskname:Users:whatever:application"
The reverse operation would be:
POSIX path of alias "path:to:application"
Good luck!
JJ
_______________________________________________
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.