Skip to content

Instantly share code, notes, and snippets.

tell application "System Events"
set ProcessList to name of every process
if "Preview" is in ProcessList then
tell application "Preview"
activate
end tell
delay 0.5
do shell script "screencapture -R10,223,711,520 -c"
else
do shell script "screencapture -R326,290,530,400 -c" #whatever other screenshot parameters you use
tell application "Things3"
set theToken to "YOUR-TOKEN"
set theTodos to to dos of list "Today"
repeat with aTodo in theTodos
set tagList to tags of aTodo
repeat with aTag in tagList
if (name of aTag as text) is "♻︎" then
if class of aTodo is project then
set urlCommand to "update-project"
set todayDate to (current date)
set theWeekday to weekday of todayDate
if theWeekday = Sunday then
set thisweeksSunday to todayDate
else
set thisweeksSunday to my DateOfThisInstanceOfThisWeekdayBeforeOrAfterThisDate(todayDate, Sunday, -1)
end if
@codingbulljunky
codingbulljunky / n1.applescript
Created March 25, 2020 21:45
date_by_weekday_Sunday
set todayDate to (current date)
set theWeekday to weekday of todayDate
if theWeekday = Sunday then
set thisweeksSunday to todayDate
else
set thisweeksSunday to my DateOfThisInstanceOfThisWeekdayBeforeOrAfterThisDate(todayDate, Sunday, -1)
end if
@codingbulljunky
codingbulljunky / Citrix.applescript
Created March 25, 2020 21:10
Citrix.applescript
set cxviewer to my is_running("Citrix Viewer")
-
if cxviewer is true then
tell application "Citrix Viewer"
activate
end tell
tell application "System Events"
--your username
tell application "Things3"
set theTag to "📞"
set theAnytimeToDos to to dos of list "Anytime"
set theUpcomingToDos to to dos of list "Upcoming"
set theToDos to theAnytimeToDos & theUpcomingToDos
repeat with aTodo in theToDos
set theName to name of aTodo
if theName contains "call" then
if theName does not contain "submission" then
tell application "Things3"
set theTag to "@"
set theAnytimeToDos to to dos of list "Anytime"
set theUpcomingToDos to to dos of list "Upcoming"
set theToDos to theAnytimeToDos & theUpcomingToDos
repeat with aTodo in theToDos
set theName to name of aTodo
if theName contains "email" then
tell application "Things3"
set theTag to "⏰"
set theAnytimeToDos to to dos of list "Anytime"
set theUpcomingToDos to to dos of list "Upcoming"
set theToDos to theAnytimeToDos & theUpcomingToDos
repeat with aTodo in theToDos
set theDue to due date of aTodo
if theDue is not missing value then
@codingbulljunky
codingbulljunky / cocoa-applescript main.scpt
Created January 9, 2020 05:41
Retroactive Things Completion Date
-- main.scpt
-- Cocoa-AppleScript Applet
--
-- Copyright 2011 {Your Company}. All rights reserved.
-- This is the main script for a Cocoa-AppleScript Applet.
-- You can put the usual script applet handlers here.
use AppleScript version "2.4"
use scripting additions
tell application "Things3"
set theToDos to to dos of list "Today"
repeat with eachToDo in theToDos
if name of eachToDo contains "Readings_" then
set theChapter to name of eachToDo as string
set status of eachToDo to completed
set thePath to notes of eachToDo
end if
end repeat
end tell