![]() Tested with OS X Yosemite 10.10.5, Script Editor 2.7, AppleScript 2.4, Pashua 0.10. 'Simple' means: It's limited to dialog windows, and the number of different GUI widgets available is currently limited to text input fields, checkboxes, radiobuttons, popup menus, combo boxes, texts, cancel and default buttons. Tested with OS X Yosemite 10.10.5, Script Editor 2.7, AppleScript 2.4, Pashua 0.10.3 Pashua is a tool for creating simple, but native Aqua GUIs for Perl, PHP, shell scripts or AppleScript. It's important to note that your compiled Applescript (.scpt) and the compiled Pashua.scpt are required to reside in the same folder if using the load script approach used in the script above. Install Pashua into your Applications folder. Sample scripts are included in the Pashua download. substitute the file path to an image where it is stored on your computer Img.path = " & ("/Users/pd/Desktop/peterson.JPG") & return ![]() Img.tooltip = This is an element of type “image” On getDialogConfiguration(pashuaLocation) Returns the configuration string for an example dialog The cancelbutton (named "cb" in the config string) was pressedĭisplay dialog "The dialog was cancelled"ĭisplay alert "An error occurred" message errorMessage as warning of theResult") are defined in theĭisplay alert "Empty return value" message "It looks like Pashua had some problems using the window configuration." as warningĮlse if cb of theResult is not "1" and "Adrian Peterson" = tf of theResult thenĭisplay alert "Right On!" message "Adrian Peterson is the correct answer."Įlse if cb of theResult is not "1" and "" ≠ tf of theResult thenĭisplay alert "Oops!" message tf of theResult & " is not the correct answer." & return & return & "The correct answer is Adrian Peterson"Įlse if cb of theResult is not "1" and "" = tf of theResult thenĭisplay dialog "The dialog was closed without submitting the values" Set theResult to showDialog(dialogConfiguration, customLocation) Set dialogConfiguration to my getDialogConfiguration(pashuaLocation) Set pashuaLocation to getPashuaPath(customLocation) Set thePath to alias (thisFolder & "Pashua.scpt") Search for Pashua in the standard locations Looks like the Pashua disk image is mounted. Set thisFolder to (container of (path to me)) as string Get the path to the folder containing this script Or use the "load script" approach used in this file. You can either take the handlers out of Pashua.scpt and use them inline whenever you writeĪ script which uses Pashua, use Pashua.scpt as an AppleScript Library (OS X 10.9 or newer) Pashua.scpt handles the communcation with Pashua.app. This example loads script "Pashua.scpt" (to be compiled from "Pashua.applescript") from the Note: This script is modified from the original example by the user. One option is to use Carsten Blüm's Pashua with AppleScript.
0 Comments
Leave a Reply. |