text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
end showChoices
|
dialog.applescript
|
on showChoicesWithDefault(theTitle, message, choices as list, defaultButton)
|
dialog.applescript
|
display dialog message with title theTitle with icon 1 buttons choices default button defaultButton
|
dialog.applescript
|
end showChoicesWithDefault
|
dialog.applescript
|
on showChoicesWithTimeout(theTitle, message, choices as list, defaultChoice, timeoutSec)
|
dialog.applescript
|
display dialog message with title theTitle with icon 1 buttons choices default button defaultChoice giving up after timeoutSec
|
dialog.applescript
|
set response to button returned of result
|
dialog.applescript
|
if response is "" then return defaultChoice
|
dialog.applescript
|
response
|
dialog.applescript
|
end showChoicesWithTimeout
|
dialog.applescript
|
on confirmWarning(theTitle as text, yourMessage as text)
|
dialog.applescript
|
display alert theTitle message yourMessage as critical buttons {"Yes", "No"} default button "no"
|
dialog.applescript
|
button returned of result is equal to "Yes"
|
dialog.applescript
|
end confirmWarning
|
dialog.applescript
|
on confirmWarningWithTimeout(theTitle as text, yourMessage as text, timeoutSec)
|
dialog.applescript
|
display alert theTitle message yourMessage as critical buttons {"Yes", "No"} default button "no" giving up after timeoutSec
|
dialog.applescript
|
end confirmWarningWithTimeout
|
dialog.applescript
|
on showWarningDialog(theTitle, message)
|
dialog.applescript
|
display dialog message with title theTitle with icon 2 buttons {"OK"}
|
dialog.applescript
|
end showWarningDialog
|
dialog.applescript
|
set logger to std's import("logger")'s new("dialog")
|
dialog.applescript
|
SFR_Unescape("/</:foo/:/=bar/:/>")
|
SFR_Unescape.applescript
|
set someString to replaceSimple({someString, "/" & oneChar, oneChar})
|
SFR_Unescape.applescript
|
fmGUI_Menu_OpenLayouts({})
|
fmGUI_Menu_OpenLayouts.applescript
|
set openManageLayoutsMenuItem to first menu item of menu 1 of menu item "Manage" of menu 1 of menu bar item "File" of menu bar 1 whose name starts with "Layouts"
|
fmGUI_Menu_OpenLayouts.applescript
|
fmGUI_ClickMenuItem({menuItemRef:openManageLayoutsMenuItem})
|
fmGUI_Menu_OpenLayouts.applescript
|
return windowWaitUntil({windowName:"Manage Layouts"})
|
fmGUI_Menu_OpenLayouts.applescript
|
error "Couldn't fmGUI_Menu_OpenLayouts - " & errMsg number errNum
|
fmGUI_Menu_OpenLayouts.applescript
|
set var1 to the name of (path to desktop)
|
004_02_name_property.applescript
|
property pTagName : "Session"
|
select_contents_of_nth_tag.scpt
|
property pIndex : 200
|
select_contents_of_nth_tag.scpt
|
set vResult to display dialog "Choose a \"tag#index\" pair." default answer (my pTagName) & "#" & (my pIndex) buttons {"Cancel", "Ok"} default button "Ok"
|
select_contents_of_nth_tag.scpt
|
if not (vResult's button returned) is "Ok" then
|
select_contents_of_nth_tag.scpt
|
error "Unsupported button \"" & vResult's button returned & "\"."
|
select_contents_of_nth_tag.scpt
|
set {vDelimiters, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "#"}
|
select_contents_of_nth_tag.scpt
|
set vParts to text items of vResult's text returned
|
select_contents_of_nth_tag.scpt
|
if (length of vParts) ≠ 2 then
|
select_contents_of_nth_tag.scpt
|
error "Specify a tag name and index separated by a hash mark '#'. (i.e., \"Session#200\")"
|
select_contents_of_nth_tag.scpt
|
set {vTagName, vIndex} to vParts
|
select_contents_of_nth_tag.scpt
|
set my pTagName to (first word of vTagName) as string
|
select_contents_of_nth_tag.scpt
|
set my pIndex to vIndex as integer
|
select_contents_of_nth_tag.scpt
|
set vParts to 0
|
select_contents_of_nth_tag.scpt
|
set vTag to "<" & (my pTagName) & ">"
|
select_contents_of_nth_tag.scpt
|
set vEndTag to "</" & (my pTagName) & ">"
|
select_contents_of_nth_tag.scpt
|
set vDocument to first text document of first window
|
select_contents_of_nth_tag.scpt
|
set vOptions to {starting at top:true, wrap around:false, returning results:true, search mode:literal, case sensitive:false}
|
select_contents_of_nth_tag.scpt
|
set vResult to find vEndTag searching in vDocument options vOptions
|
select_contents_of_nth_tag.scpt
|
if not vResult's found then
|
select_contents_of_nth_tag.scpt
|
error "BBedit's front document has no closing " & vEndTag & " tags."
|
select_contents_of_nth_tag.scpt
|
set vMatches to vResult's found matches
|
select_contents_of_nth_tag.scpt
|
set vMatchesCount to (length of vMatches) as integer
|
select_contents_of_nth_tag.scpt
|
if (my pIndex) > vMatchesCount then
|
select_contents_of_nth_tag.scpt
|
error "BBedit's front document has less than " & (my pIndex) & " " & vTag & " tags."
|
select_contents_of_nth_tag.scpt
|
set vNthClosingTag to item (my pIndex) of vMatches
|
select_contents_of_nth_tag.scpt
|
set vEndOffset to ((vNthClosingTag's start_offset) as integer) - 1
|
select_contents_of_nth_tag.scpt
|
set vResult to 0
|
select_contents_of_nth_tag.scpt
|
set vMatches to 0
|
select_contents_of_nth_tag.scpt
|
select insertion point after character vEndOffset of vDocument
|
select_contents_of_nth_tag.scpt
|
balance tags
|
select_contents_of_nth_tag.scpt
|
display alert aMessage
|
select_contents_of_nth_tag.scpt
|
set my_input to display dialog "Fra" default answer 1
|
get_print_forms.applescript
|
set x to text returned of my_input
|
get_print_forms.applescript
|
set my_input to display dialog "til" default answer 32
|
get_print_forms.applescript
|
set y to text returned of my_input
|
get_print_forms.applescript
|
set my_input to display dialog "pages in form" default answer 16
|
get_print_forms.applescript
|
set step_by to text returned of my_input
|
get_print_forms.applescript
|
set printlist to ""
|
get_print_forms.applescript
|
repeat with i from x to y by step_by
|
get_print_forms.applescript
|
set j to i + 31
|
get_print_forms.applescript
|
if j > y then set j to y
|
get_print_forms.applescript
|
set printlist to printlist & i & "-" & j & return
|
get_print_forms.applescript
|
set the clipboard to printlist
|
get_print_forms.applescript
|
display dialog printlist
|
get_print_forms.applescript
|
property my_list : {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
|
Script 29-7.applescript
|
get middle item of FastList's my_list
|
Script 29-7.applescript
|
set FastList's my_list to FastList's my_list & FastList's my_list
|
Script 29-7.applescript
|
property clickCommandPosix : POSIX path of (((path to home folder) as string)) & "Code/applescript-fm-helper/vendor/cliclick/cliclick"
|
clickAtCoords.applescript
|
clickAtCoords(956, 293)
|
clickAtCoords.applescript
|
set xClick to round xClick rounding down
|
clickAtCoords.applescript
|
set yClick to round yClick rounding down
|
clickAtCoords.applescript
|
if xClick is less than 0 then set xClick to "=" & xClick
|
clickAtCoords.applescript
|
if yClick is less than 0 then set yClick to "=" & yClick
|
clickAtCoords.applescript
|
set shellCommand to quoted form of clickCommandPosix & " -r m:" & xClick & "," & yClick & " c:" & xClick & "," & yClick
|
clickAtCoords.applescript
|
return (xClick & "," & yClick) as string
|
clickAtCoords.applescript
|
error "unable to clickAtCoords - " & errMsg number errNum
|
clickAtCoords.applescript
|
set dropboxtoken to "yourtokennumberhere"
|
screen-shot-script.scpt
|
set tempfolder to "private/tmp/sstomitp/"
|
screen-shot-script.scpt
|
set ssfolder to do shell script ("mkdir -p " & tempfolder)
|
screen-shot-script.scpt
|
set strSerialNumber to do shell script "system_profiler SPHardwareDataType | awk '/Serial Number/ { print $4 }'"
|
screen-shot-script.scpt
|
set strDate to do shell script "date \"+%Y-%m-%d--%H.%M.%S\""
|
screen-shot-script.scpt
|
set the_named_file to strDate & "-" & strSerialNumber & ".png"
|
screen-shot-script.scpt
|
set the_wm_url to do shell script "awk '/<string>https/{ print $1}' /Library/MonitoringClient/ClientData/UnifiedStatus.plist"
|
screen-shot-script.scpt
|
set webloc_contents to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
screen-shot-script.scpt
|
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
|
screen-shot-script.scpt
|
<plist version=\"1.0\">
|
screen-shot-script.scpt
|
<dict>
|
screen-shot-script.scpt
|
<key>URL</key>" & the_wm_url & "
|
screen-shot-script.scpt
|
</dict>
|
screen-shot-script.scpt
|
</plist>"
|
screen-shot-script.scpt
|
do shell script "screencapture -C " & tempfolder & quoted form of the_named_file & " " & tempfolder & quoted form of the_named_file & "-1.png"
|
screen-shot-script.scpt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.