text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
if class of source is text then | std.applescript |
set scriptName to source | std.applescript |
set scriptName to name of source | std.applescript |
logger's fatal(scriptName & ":Error: " & errorMessage) | std.applescript |
display dialog scriptName & ":Error: " & the errorNumber & ". " & the errorMessage with title "AS: Standard Library(Auto-closes in 10s)" buttons {"OK"} giving up after 10 | std.applescript |
end catch | std.applescript |
on appExists(appName) | std.applescript |
do shell script "osascript -e 'id of application \"" & appName & "\"'" | std.applescript |
end appExists | std.applescript |
on getUsername() | std.applescript |
if my username is missing value then set my username to short user name of (system info) | std.applescript |
my username | std.applescript |
end getUsername | std.applescript |
on assertThat given condition:condition as boolean, messageOnFail:message : missing value | std.applescript |
if condition is false then | std.applescript |
if message is missing value then set message to "Assertion failed" | std.applescript |
tell me to error message | std.applescript |
logger's fatal(message) | std.applescript |
end assertThat | std.applescript |
on ternary(condition, ifTrue, otherwise) | std.applescript |
if condition then return ifTrue | std.applescript |
otherwise | std.applescript |
end ternary | std.applescript |
set logger to script "logger" | std.applescript |
logger's init() | std.applescript |
set logger to logger's new("std") | std.applescript |
set theTitles to title of every tab of window 1 | Copy Markdown Links to Tabs.applescript |
repeat with theIndex from 1 to count of theURLs | Copy Markdown Links to Tabs.applescript |
set theTitle to item theIndex of theTitles | Copy Markdown Links to Tabs.applescript |
set theURL to item theIndex of theURLs | Copy Markdown Links to Tabs.applescript |
set theResult to theResult & "- " & theLink & " | Copy Markdown Links to Tabs.applescript |
get the sayMorningR of ChosenScriptLoad | Time-Of-Day.scpt |
set morningSentence to result | Time-Of-Day.scpt |
get the sayAfternoonR of ChosenScriptLoad | Time-Of-Day.scpt |
set afternoonSentence to result | Time-Of-Day.scpt |
get the sayEveningR of ChosenScriptLoad | Time-Of-Day.scpt |
set eveningSentence to result | Time-Of-Day.scpt |
set correntDate to current date | Time-Of-Day.scpt |
set theHours to hours of (correntDate) | Time-Of-Day.scpt |
set theMinutes to minutes of (correntDate) | Time-Of-Day.scpt |
set sayWords to {"Say ", "\"Its \"", "\"And \"", "\"Minutes. \""} | Time-Of-Day.scpt |
set theTime to item 1 of sayWords & item 2 of sayWords & theHours & item 3 of sayWords & theMinutes & item 4 of sayWords | Time-Of-Day.scpt |
if theHours is less than 13 then | Time-Of-Day.scpt |
set sayNow to morningSentence | Time-Of-Day.scpt |
else if theHours is less than 18 then | Time-Of-Day.scpt |
set sayNow to afternoonSentence | Time-Of-Day.scpt |
set sayNow to eveningSentence | Time-Of-Day.scpt |
do shell script theTime & sayNow | Time-Of-Day.scpt |
return log theTime & sayNow | Time-Of-Day.scpt |
property msg1 : "display dialog return to answer" | display dialog handler.applescript |
property defaultAnswer1 : "default answer" | display dialog handler.applescript |
property msg2 : "display dialog return to button" | display dialog handler.applescript |
property buttonList : {"button1", "button2", "button3"} | display dialog handler.applescript |
dda(msg1, defaultAnswer1) | display dialog handler.applescript |
ddb(msg2, buttonList) | display dialog handler.applescript |
on dda(msg, defaultAnswer) | display dialog handler.applescript |
display dialog msg default answer defaultAnswer buttons {"OK"} default button 1 | display dialog handler.applescript |
return text returned of result | display dialog handler.applescript |
end dda | display dialog handler.applescript |
on ddb(msg, buttonList) | display dialog handler.applescript |
display dialog msg as text buttons buttonList default button length of buttonList | display dialog handler.applescript |
return button returned of result | display dialog handler.applescript |
end ddb | display dialog handler.applescript |
set downloadfolder to POSIX path of (choose folder with prompt "Please select an output folder:") | downloadWordPressMedia.scpt |
set pagecountstart to 1 | downloadWordPressMedia.scpt |
set pagecountmax to 1 | downloadWordPressMedia.scpt |
set perpage to 10 --MAX =100 | downloadWordPressMedia.scpt |
set blogurl to "FILL-IN-THE-URL" | downloadWordPressMedia.scpt |
if blogurl = "FILL-IN-THE-URL" then | downloadWordPressMedia.scpt |
display dialog "You need to edit the script to fill in a url" buttons "OK" default button "OK" | downloadWordPressMedia.scpt |
repeat with pagecount from pagecountstart to pagecountmax | downloadWordPressMedia.scpt |
set bURL to blogurl & "/wp-json/wp/v2/media/?per_page=" & perpage & "&page=" & pagecount | downloadWordPressMedia.scpt |
set thejson to fetch JSON from bURL | downloadWordPressMedia.scpt |
set theimgs to {} | downloadWordPressMedia.scpt |
set imageCount to count of thejson | downloadWordPressMedia.scpt |
repeat with n from 1 to imageCount | downloadWordPressMedia.scpt |
set end of theimgs to source_url of item n of thejson | downloadWordPressMedia.scpt |
repeat with img in theimgs | downloadWordPressMedia.scpt |
set cmd to "curl -L " & img & " > " & downloadfolder & filenamefromurl(img) | downloadWordPressMedia.scpt |
on filenamefromurl(theurl) | downloadWordPressMedia.scpt |
set s to "url=\"" & theurl & "\"; echo \"${url##*/}\"" | downloadWordPressMedia.scpt |
return do shell script s | downloadWordPressMedia.scpt |
end filenamefromurl | downloadWordPressMedia.scpt |
set projnameterm to (create window with default profile) | generic-dev.scpt |
tell projnameterm | generic-dev.scpt |
set servertab to (first tab) | generic-dev.scpt |
tell servertab | generic-dev.scpt |
repeat with aSession in sessions | generic-dev.scpt |
set name to "projname-server" | generic-dev.scpt |
write text "cd ~/src/projname/" | generic-dev.scpt |
write text "foreman start web" | generic-dev.scpt |
set cmdtab to (create tab with default profile) | generic-dev.scpt |
tell cmdtab | generic-dev.scpt |
write text "open -a MacVim ." | generic-dev.scpt |
system attribute "HOME" | system attribute "HOME".applescript |
fmGUI_SelectAll() | fmGUI_SelectAll.applescript |
on fmGUI_SelectAll() | fmGUI_SelectAll.applescript |
set SelectAllMenuItem to menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1 | fmGUI_SelectAll.applescript |
return fmGUI_ClickMenuItem({menuItemRef:SelectAllMenuItem, waitForMenuAvailable:true}) | fmGUI_SelectAll.applescript |
error "Couldn't fmGUI_SelectAll - " & errMsg number errNum | fmGUI_SelectAll.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.