• 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: Script Menu in 10.6.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Menu in 10.6.2


  • Subject: Re: Script Menu in 10.6.2
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 07 Feb 2010 15:14:51 -0600

On Feb 3, 2010, at 10:35 AM, Steve Valenti wrote:

Is anyone else experiencing problems when placing a script in the script menu. This simple script should display all files in the document folder and allow you to choose one from the list. It works when run from Applescript editor but place it in the script menu and you can’t choose anything…
 
tell application "Finder"
          set ListOfFiles to name of files of folder (path to documents folder)
end tell
set ChosenFile to (choose from list ListOfFiles with prompt "Select a File and press Choose" OK button name "Choose")

I just noticed that if you ...
1. Launch the script above from the Script menu;
2. Click on the desktop (or activate any application);
3. Click the choose window.
The original code, above, works.

This suggests modifying the code as follows ...

tell application "Finder"
activate -- necessary
set ListOfFiles to name of files of folder (path to documents folder)
end tell
activate -- desirable
set ChosenFile to (choose from list ListOfFiles with prompt "Select a File and press Choose" OK button name "Choose")

This code now works as expected without the user having to know any magic incantation.

Also, when you run a script via Script menu, it is AppleScript Runner (in Core Services) that actually runs the script. And AppleScript Runner is scriptable. Those of you who are interested might want to look at its dictionary.

 _______________________________________________
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: 
 >Script Menu in 10.6.2 (From: "Steve Valenti" <email@hidden>)

  • Prev by Date: Re: Stuffit Deluxe not applescriptable in 10.6.2
  • Next by Date: Re: Stuffit Deluxe not applescriptable in 10.6.2
  • Previous by thread: Re: Script Menu in 10.6.2
  • Next by thread: Finder BUGS?
  • Index(es):
    • Date
    • Thread