How do I make an AppleScript that displays a drop-down menu without using Xcode?
|
There is no built in concept of a menu in the dialogs-alerts within the AppleScript language. The closest you could do would be to name some dummy files (in a temporary folder) with the appropriate action and have the user choose the file labeled with the action you wanted to perform.
A horrendous "solution" to a problem that needs a cocoa menu - whether you make it in Xcode or someone else does - Xcode/IB is the tool that creates a menu. MacRuby is a nice way to script an app that needs a more full featured UI than AppleScript. You don't need Xcode/IB to ruby up an app from pure script. You could create a NIB using Interface Builder and script it all using AppleScript, but the nib defines the menu itself - not AppleScript (even if AppleScript can populate or delete the menu items at run time). |
||||
|
|
|
You don't need Xcode for AppleScript. Just open the 'AppleScript Editor' in 'Applications/Utilities' (Finder shortcut for the Utilities folder: ⌘+shift+u). There is some sample code for dropdown menus here. |
|||||||
|
|
Additionally, if you just need a list to choose from, you could also do
Google "AppleScript Choose from list". |
|||
|
|
|
One option would be to use CocoaDialog:
You could also just use choose from list:
|
||||
|
|

