text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
set hoursAdjust to 0 | create_reminder_from_file.scpt |
set time of theDate to (time of theDate) + (theHours + hoursAdjust) * 3600 | create_reminder_from_file.scpt |
set time of theDate to (time of theDate) + theMinutes * 60 | create_reminder_from_file.scpt |
if theDateTimeArray's length > 1 then | create_reminder_from_file.scpt |
set theDateArray to items 1 thru -2 of theDateTimeArray | create_reminder_from_file.scpt |
set theDateArrayLen to the count of items in theDateArray | create_reminder_from_file.scpt |
if theDateArrayLen = 2 then | create_reminder_from_file.scpt |
set theRelativeDateStr to getArrayValue(theDateArray, 1) as string | create_reminder_from_file.scpt |
set theWeekdayStr to getArrayValue(theDateArray, 2) as string | create_reminder_from_file.scpt |
if "next" is in theRelativeDateStr then | create_reminder_from_file.scpt |
set time of theDate to (time of theDate) + (8 * 24 * 3600) | create_reminder_from_file.scpt |
set theDate to getWeekday(theDate, theWeekdayStr) | create_reminder_from_file.scpt |
set theDateArraySplit to theSplit(getArrayValue(theDateArray, 1), "/") | create_reminder_from_file.scpt |
set theDateArraySplitLen to the count of items in theDateArraySplit | create_reminder_from_file.scpt |
if theDateArraySplitLen = 1 then | create_reminder_from_file.scpt |
set theRelativeDayStr to getArrayValue(theDateArraySplit, 1) as string | create_reminder_from_file.scpt |
if "tod" is in theRelativeDayStr then | create_reminder_from_file.scpt |
set theDate to theDate | create_reminder_from_file.scpt |
else if "tom" is in theRelativeDayStr then | create_reminder_from_file.scpt |
set time of theDate to (time of theDate) + (24 * 3600) | create_reminder_from_file.scpt |
else if ("sun" is in theRelativeDayStr or "mon" is in theRelativeDayStr or "tue" is in theRelativeDayStr or "wed" is in theRelativeDayStr or "thu" is in theRelativeDayStr or "fri" is in theRelativeDayStr or "sat" is in theRelativeDayStr) then | create_reminder_from_file.scpt |
set theDate to getWeekday(theDate, theRelativeDayStr) | create_reminder_from_file.scpt |
set month of theDate to (item 1 of theDateArraySplit) as integer | create_reminder_from_file.scpt |
set day of theDate to (item 2 of theDateArraySplit) as integer | create_reminder_from_file.scpt |
set theNewYear to (item 3 of theDateArraySplit) as integer | create_reminder_from_file.scpt |
if theNewYear < 100 then | create_reminder_from_file.scpt |
set theCurrentYear to (year of theDate) as integer | create_reminder_from_file.scpt |
set theNewYear to theNewYear + ((theCurrentYear / 100) as integer) * 100 | create_reminder_from_file.scpt |
set year of theDate to theNewYear | create_reminder_from_file.scpt |
on theSplit(theString, theDelim) | create_reminder_from_file.scpt |
set theTrimmedArray to {} | create_reminder_from_file.scpt |
repeat with currentSplitString in theArray | create_reminder_from_file.scpt |
if currentSplitString as string is not equal to "" then | create_reminder_from_file.scpt |
set currentTrimmedString to trim(currentSplitString) | create_reminder_from_file.scpt |
copy currentTrimmedString to the end of theTrimmedArray | create_reminder_from_file.scpt |
return theTrimmedArray | create_reminder_from_file.scpt |
on getArrayValue(array, location) | create_reminder_from_file.scpt |
return item location in array | create_reminder_from_file.scpt |
end getArrayValue | create_reminder_from_file.scpt |
on getWeekday(theDate, theWeekdayStr) | create_reminder_from_file.scpt |
repeat until theWeekdayStr is in ((weekday of theDate) as string) | create_reminder_from_file.scpt |
end getWeekday | create_reminder_from_file.scpt |
on foldLeft given operator:op, initial:z, sequence:xs | Utilities.applescript |
repeat until xs = {} | Utilities.applescript |
set z to op's f(z, item 1 of xs) | Utilities.applescript |
set xs to rest of xs | Utilities.applescript |
end foldLeft | Utilities.applescript |
on filter thru predicate given sequence:xs | Utilities.applescript |
script predicateOp | Utilities.applescript |
on f(z, x) | Utilities.applescript |
if predicate's p(x) then set end of z to x | Utilities.applescript |
end f | Utilities.applescript |
return foldLeft given operator:predicateOp, initial:{}, sequence:xs | Utilities.applescript |
set WWDCNotesFileName to "WWDC 2019 Notes.ooutline" | OmniOutliner%20Transcribe%20WWDC%20Notes copy.applescript |
property wakeup_tune_file : missing value | Script 9–7.applescript |
property requested_time : "7:00" | Script 9–7.applescript |
if wakeup_tune_file is missing value then | Script 9–7.applescript |
set wakeup_tune_file to choose file with prompt "Pick a wakeup tune:" of type {"public.audio"} without invisibles | Script 9–7.applescript |
tell application "Finder" to set song_name to name of wakeup_tune_file | Script 9–7.applescript |
set tomorrow_date to (current date) + (1 * days) | Script 9–7.applescript |
set wake_dialog to display dialog "Enter time you want to wake up:" default answer requested_time buttons {"Stop", "OK"} default button "OK" | Script 9–7.applescript |
if button returned of wake_dialog is "Stop" then return | Script 9–7.applescript |
set requested_time to text returned of wake_dialog | Script 9–7.applescript |
try -- See if time entered is OK | Script 9–7.applescript |
set wakeup_date to date requested_time of tomorrow_date | Script 9–7.applescript |
on error -- Invalid time string | Script 9–7.applescript |
display dialog "Not a valid time. Please try again." | Script 9–7.applescript |
on error number -128 -- User canceled | Script 9–7.applescript |
display dialog "The song \"" & song_name & "\"" & return & "should wake you up on: " & return & wakeup_date buttons {"Change Song", "OK"} default button "OK" giving up after 15 | Script 9–7.applescript |
if button returned of result is "Change song" then | Script 9–7.applescript |
repeat until (current date) ≥ wakeup_date | Script 9–7.applescript |
open wakeup_tune_file | Script 9–7.applescript |
set audio volume to 1.0 | Script 9–7.applescript |
set days_old to get_file_age_in_days(the_file) | Script 18-21.applescript |
on get_file_age_in_days(the_file) | Script 18-21.applescript |
return days_old | Script 18-21.applescript |
end get_file_age_in_days | Script 18-21.applescript |
var of = Application('OmniFocus'); | DurationTitles.applescript |
var doc = of.defaultDocument; | DurationTitles.applescript |
var today = new Date(); | DurationTitles.applescript |
var dueDate = new Date(today.setDate(today.getDate()+7)); | DurationTitles.applescript |
var taskList = []; | DurationTitles.applescript |
var flattenedTasks = doc.flattenedTasks.whose({effectivelyCompleted: false, effectivelyDropped: false}); | DurationTitles.applescript |
flattenedTasks().forEach(function(task){
var splitString = task.name().split(" || ");
var unit = "";
if (task.estimatedMinutes() !== null) {
if (task.estimatedMinutes() > 1){
unit = " || " + task.estimatedMinutes() + " mins";
} else { | DurationTitles.applescript |
unit = " || 1 min"; | DurationTitles.applescript |
var newTitle = splitString[0] + unit; | DurationTitles.applescript |
task.name = newTitle; | DurationTitles.applescript |
}); | DurationTitles.applescript |
of.synchronize(); | DurationTitles.applescript |
windowSize's windowSize({xsize:0.5, ysize:1}) | wsHalfLeft.applescript |
set messageContent to content of eachMessage | mail_note_to_things.scpt |
set AppleScript's text item delimiters to the "Things " | mail_note_to_things.scpt |
set the item_list to every text item of messageContent | mail_note_to_things.scpt |
set messageContent to the item_list as string | mail_note_to_things.scpt |
set newToDo to make new to do with properties {name:messageContent, due date:current date} | mail_note_to_things.scpt |
do shell script "caffeinate -u -t 2" | Wake-Display.scpt |
alias ":" | alias "-".applescript |
set command to {} | open-file-in-vim.applescript |
if input is null or input is {} or ((item 1 in input) as string) is "" then | open-file-in-vim.applescript |
set end of command to "vim;exit" | open-file-in-vim.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.