text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
repeat with j from 1 to i | launch.scpt |
set sess to session j of current tab of current window | launch.scpt |
if (name of sess as string) equals "bash" | launch.scpt |
set next_ses to sess | launch.scpt |
set (item r_i of names) to (item r_i of names) & {item (c_i + 1) of row_} | launch.scpt |
set (item r_i of sessions_) to (item r_i of sessions_) & {next_ses} | launch.scpt |
set c_i to c_i + 1 | launch.scpt |
set total to i - 1 | launch.scpt |
repeat with cmd in cmds | launch.scpt |
set w_i to 1 | launch.scpt |
set name_ to item 1 of cmd | launch.scpt |
set sess to 0 | launch.scpt |
if (text item 1 of name_) equals "!" | launch.scpt |
delay (text item 2 of name_ as integer) | launch.scpt |
if name_ does not equal "*" | launch.scpt |
set sess to my getSess(sessions_, names, name_) | launch.scpt |
if sess = 0 | launch.scpt |
display dialog("ERROR") | launch.scpt |
set text_cmd to "" | launch.scpt |
repeat with i from 2 to count of cmd | launch.scpt |
set w to item i of cmd | launch.scpt |
if (text item 1 of w) is "$" | launch.scpt |
set w to item ((text item 2 of w) as integer) of vars | launch.scpt |
set text_cmd to text_cmd & w | launch.scpt |
if i does not equal count of cmd | launch.scpt |
set text_cmd to text_cmd & " " | launch.scpt |
tell sess | launch.scpt |
write text text_cmd | launch.scpt |
repeat with i from 1 to total | launch.scpt |
tell session i of current tab of current window | launch.scpt |
tell application "Viscosity" | autopush.applescript |
set vpnClientName to name of the second connection | autopush.applescript |
if the state of the second connection is not "Connected" then -- connection order based on when they were imported, and not how they are ordered in your viscosity prefs. I think. | autopush.applescript |
disconnect vpnClientName | autopush.applescript |
delay 0.7 | autopush.applescript |
connect vpnClientName | autopush.applescript |
set viscosityWindowName to "Viscosity - " & vpnClientName | autopush.applescript |
set afterWindowOpenDelay to 1 | autopush.applescript |
set duoPrompt to a reference to static text "Duo passcode or second factor:" of window viscosityWindowName of application process "Viscosity" | autopush.applescript |
set mfaInputField to a reference to text field of window viscosityWindowName of application process "Viscosity" | autopush.applescript |
set okButton to a reference to button "OK" of window viscosityWindowName of application process "Viscosity" | autopush.applescript |
repeat until exists duoPrompt | autopush.applescript |
delay afterWindowOpenDelay -- This delay is annoying, but important. The push is never sent without it | autopush.applescript |
set value of mfaInputField to "push" | autopush.applescript |
click okButton | autopush.applescript |
set trackName to name of current track | spotify copy.applescript |
set artistName to artist of current track | spotify copy.applescript |
set albumName to album of current track | spotify copy.applescript |
set playCount to played count of current track | spotify copy.applescript |
display notification albumName with title artistName & " - " & trackName | spotify copy.applescript |
previous track | spotify copy.applescript |
playpause | spotify copy.applescript |
if (do shell script "id") contains "gid=1005104282" then | mount-windows-network-shares.scpt |
mount volume "smb://10.0.0.19/c$" | mount-windows-network-shares.scpt |
mount volume "smb://10.0.0.19/public$" | mount-windows-network-shares.scpt |
set _term to (make new terminal) | sublime_deploy_in_iterm.applescript |
tell _term | sublime_deploy_in_iterm.applescript |
launch session "Default" | sublime_deploy_in_iterm.applescript |
set _session to current session | sublime_deploy_in_iterm.applescript |
write text "newline > /dev/null 2>&1" | sublime_deploy_in_iterm.applescript |
tell application "System Events" to keystroke "k" using {command down} | sublime_deploy_in_iterm.applescript |
write text "PUT YOUR SPECIFIC COMMAND HERE!" | sublime_deploy_in_iterm.applescript |
property dtDatabase : "" | Pinboard.scpt |
property pAuthToken : "" | Pinboard.scpt |
property importStrategy : "decluttered" | Pinboard.scpt |
property logVerbosity : 1 | Pinboard.scpt |
property scriptDebugging : false | Pinboard.scpt |
set silentMode to false | Pinboard.scpt |
if (item 1 of argv is "silent") then | Pinboard.scpt |
set silentMode to true | Pinboard.scpt |
my logMessage("silentMode", silentMode, 3) | Pinboard.scpt |
set _words to words of pAuthToken | Pinboard.scpt |
set pUser to item 1 of _words | Pinboard.scpt |
set theUTCDateTime to "" | Pinboard.scpt |
set logUpdateFrom to "" | Pinboard.scpt |
set theGroupComment to "" | Pinboard.scpt |
set theDatabase to open database dtDatabase | Pinboard.scpt |
set theGroup to get record at "/Pinboard" in theDatabase | Pinboard.scpt |
if (theGroup is missing value or type of theGroup is not group) then | Pinboard.scpt |
set theGroup to create location "/Pinboard" in theDatabase | Pinboard.scpt |
set thumbnail of theGroup to "https://imgur.com/download/UfP65so" -- PNG of a macOS folder with embosses Pinboard pin. Created using Lucas Garron's Folderify: https://github.com/lgarron/folderify | Pinboard.scpt |
set logUpdateFrom to "Group not found or has no comment, assuming we need to start from scratch!" | Pinboard.scpt |
set theGroupComment to theGroup's comment as text | Pinboard.scpt |
if theGroupComment is not "" then | Pinboard.scpt |
tell application "System Events" to set theDate to (my dateFromRfc3339String:theGroupComment) as date | Pinboard.scpt |
set theUTCDateTime to (my rfc3339FromDate:theDate) | Pinboard.scpt |
set logUpdateFrom to "Group has comment, we start from " & theUTCDateTime | Pinboard.scpt |
my logMessage(error_message, error_number, 4) | Pinboard.scpt |
set logUpdateFrom to "Group has no comment, assuming we need to start from scratch!" | Pinboard.scpt |
logMessage("Import strategy:", importStrategy, 1) | Pinboard.scpt |
logMessage("Update strategy:", logUpdateFrom, 1) | Pinboard.scpt |
logMessage("Import posts created on or after:", theUTCDateTime, 1) | Pinboard.scpt |
if (theUTCDateTime is not "") then | Pinboard.scpt |
set thePinboardURL to "https://api.pinboard.in/v1/posts/all?auth_token=" & pAuthToken & "&fromdt=" & theUTCDateTime | Pinboard.scpt |
if scriptDebugging then | Pinboard.scpt |
set thePinboardURL to "https://api.pinboard.in/v1/posts/recent?auth_token=" & pAuthToken | Pinboard.scpt |
set thePinboardURL to "https://api.pinboard.in/v1/posts/all?auth_token=" & pAuthToken | Pinboard.scpt |
logMessage("thePinboardURL:", thePinboardURL, 2) | Pinboard.scpt |
set theXML to download markup from thePinboardURL encoding "UTF-8" | Pinboard.scpt |
if (theXML is missing value or theXML is "") then | Pinboard.scpt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.