• 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: Scripting alerts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting alerts


  • Subject: Re: Scripting alerts
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 02 Dec 2014 23:26:10 +1100

If anyone is interested, I've taken the script posted here, added a couple of other bits, and wrapped it in terminology to make it easier to use. You can download Dialog Toolkit via the link at the bottom of this page: <http://www.macosxautomation.com/applescript/apps/>.

Script Editor in Yosemite seems to have a bug opening library dictionaries, so you may have to use its Open Dictionary... command to see the terminology. Here it is in full:


Alert SuiteContains commands for displaying enhanced alert.
lib version v : Library version.
lib version
→ text : Returns the version of the library.
check for main v : Check if script is running in foreground. Call first to avoid crashes.
check for main
max width for labels v : Get the width required for the longest of the supplied label strings.
max width for labels list of text : A list of label strings to measure.
→ integer : The length of the longest of the supplied strings.
display enhanced alert v : Display alert with accessory view.
display enhanced alert any : The alert text, which appears in bold.
message text : The explanatory message.
as critical/‌informational/‌warning : The type of alert.
buttons list of text : A list of button names.
suppression boolean : Whether the suppression checkbox should appear.
giving up after number : Number of seconds to wait before dismissing the alert.
acc view width integer : The width of the accessory view in points.
acc view height integer : The height of the accessory view in points.
acc view controls list of any : A list of the controls to be included in the accessory view.
→ list of any : A list consisting of the name of the button pressed (or 'Gave Up'), the boolean state of the suppression button, and a list of the values of the controls passed in 'acc view controls'.
alert type enum : Alert type.
critical : Critical.
informational : Informational.
warning : Warning.
create label v : Create a text label.
create label text : Text of the label.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
max width integer : The maximum width of the control.
aligns left aligned/‌right aligned/‌center aligned : Text alignment of label. Pass the string 'left', 'right' or 'center'.
multiline any : Whether the label will wrap to multiple lines if needed.
→ list of any : A list containing the label, the distance of its top from the bottom of the accessory view, and its actual width.
label alignment enum : 
left aligned : Left.
right aligned : Right.
center aligned : Center.
create field v : Create a text field for user input.
create field text : Initial contents of the field.
placeholder text text : Placeholder text to appear when field is empty.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
field width integer : Width of the field.
extra height integer : If more than 0, the field will be deepened by this amount, and the text within it will wrap if necessary.
→ list of any : A list containing the field, and the distance of its top from the bottom of the accessory view.
create top labeled field v : Create an entry field with a single-line label at the top.
create top labeled field text : Initial contents of the field.
placeholder text any : Placeholder text to appear when field is empty.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
field width integer : Width of the field.
extra height integer : If more than 0, the field will be deepened by this amount, and the text within it will wrap if necessary.
label text text : Contents of the label.
→ list of any : A list containing the field, the label, and the distance from the top of the label to the bottom of the accessory view.
create side labeled field v : Create an entry field with a label to its left.
create side labeled field text : Initial contents of the field.
placeholder text text : Placeholder text to appear when field is empty.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
total width integer : Total width of the label and field combined.
label text text : Contents of the label.
field left integer : How much to inset the field from the accessory view's left. If less than 'left inset' value, it will be ignored.
→ list of any : A list containing the field, the label, the distance from the top of the label to the bottom of the accessory view, and the width of the field.
create popup v : Create a popup menu.
create popup list of text : A list of menu item names.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
popup width integer : Width of the popup menu.
→ list of any : A list containing the popup, and the distance from the top of the popup to the bottom of the accessory view.
create labeled popup v : Create a popup menu with a label.
create labeled popup list of text : A list of menu item names.
left inset integer : How much to inset the labeled control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
popup width integer : Width of the popup menu.
max width integer : Maximum width of the label plus control.
label text integer : Contents of the label.
popup left integer : How much to inset the popup from the accessory view's left. If less than 'left inset' value, it will be ignored.
→ list of any : A list containing the popup, the label, the distance from the top of the popup to the bottom of the accessory view, and the distance from the popup to the left of the accessory view.
create checkbox v : Create a checkbox.
create checkbox any : The title of the checkbox.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
max width integer : Maximum width of the control.
initial state boolean : Whether the checkbox is initially checked.
→ list of any : A list containing the checkbox, the distance from the top of the checkbox to the bottom of the accessory view, and the width of the checkbox.
create labeled checkbox v : Create a checkbox with a label to its left.
create labeled checkbox text : Description of direct parameter.
left inset integer : How much to inset the labeled control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
max width integer : Maximum width of the label plus control.
label text integer : Contents of the label.
checkbox left integer : How much to inset the checkbox from the accessory view's left. If less than 'left inset' value, it will be ignored.
initial state boolean : Whether the checkbox is initially checked.
→ list of any : A list containing the checkbox, the label, the distance from the top of the checkbox to the bottom of the accessory view, and the distance from the checkbox to the left of the accessory view.
create path control v : Create a path control.
create path control text : The POSIX path of the initial path to be displayed in the path control.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
control width integer : The width of the path control.
pops up boolean : If true, it will be a pop-up path control; if false, it will be a standard control path.
→ list of any : A list containing the path control, and the distance from the top of the path control to the bottom of the accessory view.
create labeled path control v : Create a path control with a label above it.
create labeled path control text : The POSIX path of the initial path to be displayed in the path control.
left inset integer : How much to inset the labeled control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
control width integer : The width of the path control.
pops up boolean : If true, it will be a pop-up path control; if false, it will be a standard control path.
label text text : Contents of the label.
→ list of any : A list containing the path control, the label, and the distance from the top of the path control to the bottom of the accessory view.
create matrix v : Create a matrix of radio buttons.
create matrix list of text : A list of names for the radio buttons.
left inset integer : How much to inset the control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
max width integer : Maximum width of the control.
arranged vertically boolean : If true, the buttons will appear in a single column; if false, they will appear in a single row.
→ list of any : A list containing the matrix, the distance of its top from the bottom of the accessory view, and its width.
create labeled matrix v : Create a matrix of radio buttons, with a label to the left aligned vertically with the first button.
create labeled matrix list of text : A list of names for the radio buttons.
left inset integer : How much to inset the labeled control from the left of the accessory view.
bottom integer : The distance from the bottom of the accessory view to the bottom of the control.
max width integer : Maximum width of the label plus control.
arranged vertically boolean : If true, the buttons will appear in a single column; if false, they will appear in a single row.
matrix left integer : How much to inset the matrix from the accessory view's left. If less than 'left inset' value, it will be ignored.
label text text : Contents of the label.
→ list of any : A list containing the matrix, the label, the distance from the top of the matrix to the bottom of the accessory view, and the distance from the matrix to the left of the accessory view.
create rule v : Create a horizontal rule.
create rule integer : The distance from hte bottom of the accessory view.
left inset integer : Description of parameter.
rule width integer : The width of the rule.
→ list of any : A list containing the rule, and the distance of its top from the bottom of the accessory view.

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Prev by Date: Re: [rant] "Never mind the quality, feel the width!"
  • Next by Date: Safari - do JavaScript
  • Previous by thread: Re: Stack Overflow
  • Next by thread: Safari - do JavaScript
  • Index(es):
    • Date
    • Thread