Running Scripts
GarageSale lets you define custom JavaScript actions to process listings and inventory items in your library. Since these scripts are executed within GarageSale itself, they offer far better performance than AppleScript.
You can create and run scripts from the Show Script Editor Window command in the Windows menu.
Accessing all listings
You can access all listings in your GarageSale library through the allListings
variable.
Accessing selected listings
You can access the currently selected listings in GarageSale’s outline view through the selectedListings
variable.
Displaying alerts to the user
The displayDialog()
function presents the user with dialog with a custom message and one or two buttons. The title of the clicked button is the result of the function.
Letting the user select listings
The askForListings()
function presents the user with a list of listings. The user can select multiple listings and approve the selection using the default button (first button), or cancel the selection using the alternate button (second button), in which case no listings are returned.
This function will block the execution of your script until the user has closed the panel by clicking one of the buttons.
Showing listings to the user
The showListings
function will present a list of listings to the user.
This function will not block your script from executing. It can be invoked multiple times, and the windows will stay open after your script has finished executing.
If the user clicks on a listing in the list, it will get selected in GarageSale’s main window.
<< Modifying Selected Orders | Validating scripts when launching listings >> |