• 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: non-existant app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-existant app


  • Subject: Re: non-existant app
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 31 Jan 2010 16:23:49 -0600

On Jan 31, 2010, at 3:36 PM, Robert Poland wrote:

On this shortened script, if the machine does not have Dreamweaver is there a better way to avoid the script hunting for a non-existant app?

I ran into that problem once with a script where the user may or may not have the application Smile.
I did this ...

if frontProc is "Smile" then
"tell application \"Smile\"" & return & "activate" & return & ¬
"if class of window 1 is not script window then error" & return & ¬
"save window 1" & return & "path name of window 1" & return & "end tell"
try
set docAlias to (run script the result) as alias
on error
error "Smile's frontmost window is not a script window or" & return & "Smile can't find the saved copy of the current document." & return & ¬
"Save it to a project folder and try again." -- window 1 has no associated file
end try

In this case the script text was short. If you have a large set of handlers for Dreamweaver, you might write them as a loadable script file, then do something like this ...

if frontProc is "Dreamweaver" then
set dwScript to load script <alias_to_script_file_for_dreamweaver>
someHandler() of dwScript

But, would this protect from the "Where is application ..." dialog?
It seems reasonable that it would, but I haven't tested it.
 _______________________________________________
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: 
 >non-existant app (From: Robert Poland <email@hidden>)

  • Prev by Date: non-existant app
  • Next by Date: Re: non-existant app
  • Previous by thread: non-existant app
  • Next by thread: Re: non-existant app
  • Index(es):
    • Date
    • Thread