• 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
Where is application dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Where is application dialog


  • Subject: Where is application dialog
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 16 Nov 2008 14:30:37 -0600

I have a script, written primarily for Leopard, that contains the following code for backward compatibility with Tiger 10.4.11 ...


if sysIsTiger then
try
run script "tell application \"AppleScript Utility\" to activate"
on error
error "The Script menu is not available because the application AppleScriptUtility cannot be found."
end try
activate me
"The \"Show Script menu in menu bar\" box" & return & "must be checked in AppleScript Utility." & return ¬
& "Check it now, if necessary," & return & "then close AppleScript Utility."
tell me to display dialog the result with title shortTitle buttons {"OK"} default button 1
end if

Leopard's AppleScript Utility is scriptable, but Tiger's is not, so my script has to activate it, then instruct the user. If AppleScript Utility is installed somewhere (and it probably is), the script works perfectly.

But, what if AppleScript Utility is not available?  'run script ...' should simply return an error ... but it doesn't !!!! Instead it asks the user to choose any application to be used instead of AppleScript Utility. If the user chooses, for example, "Calculator", then on EVERY subsequent run of this script, Calculator is activated and the user is instructed ...

The "Show Script menu in menu bar" box
must be checked in AppleScript Utility.
Check it now, if necessary,
then close AppleScript Utility.

An AppleScripter will see what is happening, and choose "Cancel" every time.
But my user's (and yours) have probably never heard of AppleScript and will simply be very confused. They will invariably, at some point, choose any old application from the list.

The "Where is ... ?" dialog opens the inner workings of an AppleScript-ed application to permanent damage. In BOTH Tiger and Leopard. It's just that in Leopard, I can avoid the dialog by using 'application id'.

THE "Where is ... ?" DIALOG MUST BE AVOIDED. BETTER YET, IT SHOULD NOT EVEN BE PRESENT IN THE NEXT VERSION OF APPLESCRIPT. IT'S DANGEROUS.

But, how can I avoid the "Where is ... ?" dialog in Tiger? I don't think I can.
(But, perhaps someone knows more about this?)
I will probably have to simply present the dialog ...

If the Script menu is not visible in the menu bar,
launch AppleScript Utility, in the AppleScript folder
in the Applications folder, then check the box
  "Show Script menu in menu bar".

Some will read and comply, others will just not get it.

If you want to experiment with this in Leopard, use this ...

try
run script "tell application \"AppleScript Utility\" to activate"
-- replace "AppleScript Utility" with "anynonsense" to test non-existence
-- DO NOT, DO NOT, DO NOT remove the AppleScript Utility application
on error errText number errNr
activate me
tell me to display dialog "Application does not exist." buttons {"OK"} default button 1
return
end try
activate me
tell me to display dialog "Go!"

And READ THE WARNING. I first tried removing AppleScript Utility just to see what would happen. And what happens is that ALL YOUR EDITABLE SCRIPT DOCUMENTS BECOME UN-EDITABLE until AppleScript Utility is restored.

 _______________________________________________
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:
    • Re: Where is application dialog
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Entourage - save calendar as web page
  • Next by Date: Re: Where is application dialog
  • Previous by thread: Skip the eventual two Finder floating windows [Leopard]
  • Next by thread: Re: Where is application dialog
  • Index(es):
    • Date
    • Thread