• 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: running an application without a name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Problem suppressing PhotoShop 7 dialogs
  • Next by Date: Re: How easy is it to do GUIs in Applescript?
  • Previous by thread: running an application without a name
  • Next by thread: Problem suppressing PhotoShop 7 dialogs
  • Index(es):
    • Date
    • Thread