text
stringlengths
0
15.7k
source
stringlengths
6
112
set shallArgv to item 1 of argv as text
things-to-fantastical.applescript
if shallArgv contains "/" then
things-to-fantastical.applescript
set onDate to date shallArgv as date
things-to-fantastical.applescript
set onDateString to "" & month of onDate & " " & day of onDate & " " & year of onDate as text
things-to-fantastical.applescript
repeat with todo in todos
things-to-fantastical.applescript
set myNote to notes of todo as text
things-to-fantastical.applescript
set query to "" & "'> " & name of todo & "' " & completion date of todo as text
things-to-fantastical.applescript
set title to "" & "'> " & name of todo & "' " & onDateString as text
things-to-fantastical.applescript
set calName to "Work" as text
things-to-fantastical.applescript
set myArea to area of todo
things-to-fantastical.applescript
set myAreaName to "" as text
things-to-fantastical.applescript
set myAreaName to "" & name of myArea
things-to-fantastical.applescript
if myAreaName contains "Life" then
things-to-fantastical.applescript
set calName to "Life"
things-to-fantastical.applescript
if query contains onDateString then
things-to-fantastical.applescript
tell application "Fantastical 2" to parse sentence title notes myNote calendarName calName with add immediately
things-to-fantastical.applescript
delay 2.0
things-to-fantastical.applescript
do shell script "networksetup -setairportpower en1 on"
sync_bento copy.applescript
set pword to "password"
sync_bento copy.applescript
tell application "Bento" to activate
sync_bento copy.applescript
delay 5
sync_bento copy.applescript
keystroke pword
sync_bento copy.applescript
keystroke tab
sync_bento copy.applescript
keystroke space
sync_bento copy.applescript
set visible of every process whose visible is true and name is "Bento" to false
sync_bento copy.applescript
delay 60
sync_bento copy.applescript
tell application "Bento" to quit
sync_bento copy.applescript
do shell script "networksetup -setairportpower en1 off"
sync_bento copy.applescript
writeToFile({outputText:"bob", appendText:true})
writeToFile.applescript
on writeToFile(prefs)
writeToFile.applescript
set defaultPrefs to {outputText:"", fullFilePath:null, fileName:null, fileDirectory:(path to desktop) as string, appendText:false, appendLine:true}
writeToFile.applescript
set prefs to prefs & defaultPrefs
writeToFile.applescript
set outputText to outputText of prefs
writeToFile.applescript
if fullFilePath of prefs is not null then
writeToFile.applescript
set outputFile to fullFilePath of prefs
writeToFile.applescript
else if fileName of prefs is not null then
writeToFile.applescript
set outputFile to fileDirectory of prefs & fileName of prefs
writeToFile.applescript
set outputFile to ((path to desktop) as string) & "ASFileWrittenBy_htcLib.txt"
writeToFile.applescript
set fileReference to open for access file outputFile with write permission
writeToFile.applescript
set fileReference to open for access POSIX file outputFile with write permission
writeToFile.applescript
if appendText of prefs is false then
writeToFile.applescript
set eof of the fileReference to 0
writeToFile.applescript
else if appendLine of prefs is true then
writeToFile.applescript
set outputText to return & outputText
writeToFile.applescript
write outputText to fileReference starting at eof
writeToFile.applescript
close access fileReference
writeToFile.applescript
return true
writeToFile.applescript
close access file outputFile
writeToFile.applescript
return false
writeToFile.applescript
end writeToFile
writeToFile.applescript
set chosenCli to choose file with prompt "Please select the sublime-cli:" default location POSIX file "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
setup-sublime-text-cli.applescript
set chosenCli to choose file with prompt "Please select the redis-cli:" default location POSIX file "/opt/homebrew/bin/subl"
setup-sublime-text-cli.applescript
do shell script "plutil -replace 'Sublime Text CLI' -string \"" & (POSIX path of chosenCli) & "\" ~/applescript-core/config-system.plist"
setup-sublime-text-cli.applescript
tell application id "DNtp"
Set Name To X Subject.applescript
set theSelection to the selection
Set Name To X Subject.applescript
if theSelection is {} then error "Please select some contents."
Set Name To X Subject.applescript
repeat with theRecord in theSelection
Set Name To X Subject.applescript
set theMD to meta data of theRecord
Set Name To X Subject.applescript
set theSubject to |kMDItemSubject| of theMD
Set Name To X Subject.applescript
set theSubject to |kMDItemHeadline| of theMD
Set Name To X Subject.applescript
set name of theRecord to theSubject
Set Name To X Subject.applescript
on error error_message number error_number
Set Name To X Subject.applescript
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
Set Name To X Subject.applescript
set current pane to pane "com.apple.preference.keyboard"
fn-toggle.scpt
tell application process "System Preferences"
fn-toggle.scpt
get properties
fn-toggle.scpt
delay 0.3
fn-toggle.scpt
set theCheckbox to checkbox "Use F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard"
fn-toggle.scpt
click theCheckbox
fn-toggle.scpt
tell theCheckbox
fn-toggle.scpt
if (its value as boolean) then
fn-toggle.scpt
display notification "Using standard F1, F2, F3, F4, ..."
fn-toggle.scpt
display notification "FN Locked (special function keys activated)"
fn-toggle.scpt
delay 1 # necessary to keep the notification, otherwise it will die with the script
fn-toggle.scpt
display alert "The header line" message "Something went horribly wrong and your machine may explode. Do you want to abort the task, continue on bravely, or go to a website where someone will panic for you?" as critical buttons {"Quit", "Continue", "Go to website"} default button "Quit"
alert_with_hyperlink.applescript
set response to button returned of the result
alert_with_hyperlink.applescript
if response is "Go to website" then open location "http://your.website.of.choice"
alert_with_hyperlink.applescript
delay 1 -- wait for pane to load. May not be long enough.
toggle_fn_keys.scpt
if UI elements enabled then
toggle_fn_keys.scpt
tell tab group 1 of window "Keyboard" of process "System Preferences"
toggle_fn_keys.scpt
set theBoxes to checkboxes
toggle_fn_keys.scpt
set funcCheckBox to item 3 of theBoxes
toggle_fn_keys.scpt
if (name of funcCheckBox is "Use F1, F2, etc. keys as standard function keys") then
toggle_fn_keys.scpt
click funcCheckBox -- to toggle it
toggle_fn_keys.scpt
tell funcCheckBox
toggle_fn_keys.scpt
if value is 0 then
toggle_fn_keys.scpt
beep 1
toggle_fn_keys.scpt
beep 2
toggle_fn_keys.scpt
display dialog "Wrong checkbox found. Did system preferences UI change?"
toggle_fn_keys.scpt
set current pane to pane "com.apple.preference.universalaccess"
toggle_fn_keys.scpt
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
toggle_fn_keys.scpt
quit
toggle_fn_keys.scpt
tell application "BetterTouchTool" to set tarAppID to get_string_variable "BTTActiveAppBundleIdentifier"
threeClickSwipeDown.applescript
tell application "AltTab" to showApp appBID tarAppID
threeClickSwipeDown.applescript
delay 0.134
threeClickSwipeDown.applescript
key code 124 # right
threeClickSwipeDown.applescript
delay 0.2
threeClickSwipeDown.applescript
key code 36 # enter
threeClickSwipeDown.applescript
if kind of container of view of front window is not library or selection of front browser window is {} then
ID3%20Track%20Numbers%20from%20Filename%20Prefixes.scpt
display dialog "Select some tracks in iTunes first." buttons {"Cancel"} default button 1 with icon 2 giving up after 15
ID3%20Track%20Numbers%20from%20Filename%20Prefixes.scpt