text
stringlengths
0
15.7k
source
stringlengths
6
112
set the low_item to ""
SortText.scpt
repeat with i from 1 to (number of items in my_list)
SortText.scpt
if i is not in the index_list then
SortText.scpt
set this_item to item i of my_list as text
SortText.scpt
if the low_item is "" then
SortText.scpt
set the low_item to this_item
SortText.scpt
set the low_item_index to i
SortText.scpt
else if this_item comes before the low_item then
SortText.scpt
set the end of sorted_list to the low_item
SortText.scpt
set the end of the index_list to the low_item_index
SortText.scpt
return the sorted_list
SortText.scpt
end simple_sort
SortText.scpt
on splitText(theText, theDelimiter)
SortText.scpt
set AppleScript's text item delimiters to theDelimiter
SortText.scpt
set theTextItems to every text item of theText
SortText.scpt
return theTextItems
SortText.scpt
end splitText
SortText.scpt
set theText to the clipboard
SortText.scpt
set the textToSort to splitText(theText, space)
SortText.scpt
set the clipboard to simple_sort(the textToSort) as text
SortText.scpt
set theAccounts to {"PledgeMusic"}
mailArchive.applescript
set theMailboxes to {"INBOX", "Sent Messages"}
mailArchive.applescript
set theDays to 363
mailArchive.applescript
repeat with theAccount in theAccounts
mailArchive.applescript
repeat with theMailbox in theMailboxes
mailArchive.applescript
set oldMessages to ((every message of mailbox theMailbox of account theAccount) whose (date sent < (current date) - theDays * days))
mailArchive.applescript
if (count oldMessages) is greater than 0 then
mailArchive.applescript
set theAccountArchive to ("Archiver" & "-" & theAccount)
mailArchive.applescript
if not (exists mailbox theAccountArchive) then
mailArchive.applescript
make new mailbox with properties {name:theAccountArchive}
mailArchive.applescript
if not (exists mailbox theMailbox of mailbox theAccountArchive) then
mailArchive.applescript
make new mailbox with properties {name:(theAccountArchive & "/" & theMailbox)}
mailArchive.applescript
repeat with oldMessage in oldMessages
mailArchive.applescript
move oldMessage to mailbox theMailbox of mailbox theAccountArchive
mailArchive.applescript
set delayOne to 0.2
mouseclick.scpt
set pageDelay to 2
mouseclick.scpt
set coordinateName to the text returned of (display dialog "Name of Coordinate Marker?" default answer "")
mouseclick.scpt
do shell script "eval $(/usr/libexec/path_helper -s); cliclick p:. | cut -d ',' -f2 | tr -d \"\\n\" | pbcopy"
mouseclick.scpt
set yCoordinate to the clipboard
mouseclick.scpt
delay delayOne
mouseclick.scpt
do shell script "eval $(/usr/libexec/path_helper -s); cliclick p:. | cut -d ',' -f1 | tr -d \"\\n\" | pbcopy"
mouseclick.scpt
set xCoordinate to the clipboard
mouseclick.scpt
set the clipboard to "
mouseclick.scpt
set " & coordinateName & "X to " & xCoordinate & "
mouseclick.scpt
set " & coordinateName & "Y to " & yCoordinate & "
mouseclick.scpt
do shell script \"eval $(/usr/libexec/path_helper -s); cliclick c:\" & " & coordinateName & "X & \",\" & " & coordinateName & "Y
mouseclick.scpt
delay " & delayOne
mouseclick.scpt
tell application "Script Editor" to activate
mouseclick.scpt
fmGUI_ManageDataSources_Save({})
fmGUI_ManageDataSources_Save.applescript
on fmGUI_ManageDataSources_Save(prefs)
fmGUI_ManageDataSources_Save.applescript
set defaultPrefs to {notInManageWindowIsError:true}
fmGUI_ManageDataSources_Save.applescript
set manageWindowNamePrefix to "Manage External Data Sources"
fmGUI_ManageDataSources_Save.applescript
set waitCycleDelaySeconds to 5 -- seconds
fmGUI_ManageDataSources_Save.applescript
set waitSaveTotalSeconds to 5 * minutes --seconds
fmGUI_ManageDataSources_Save.applescript
if name of window 1 starts with manageWindowNamePrefix then
fmGUI_ManageDataSources_Save.applescript
set manageWindowName to name of window 1
fmGUI_ManageDataSources_Save.applescript
click (button "OK" of window 1)
fmGUI_ManageDataSources_Save.applescript
delay 1 -- let click register.
fmGUI_ManageDataSources_Save.applescript
error "Couldn't save Manage Data Sources - " & errMsg number errNum
fmGUI_ManageDataSources_Save.applescript
if notInManageWindowIsError of prefs then
fmGUI_ManageDataSources_Save.applescript
error "Manage Data Source window wasn't open, so nothing to close." number 1024
fmGUI_ManageDataSources_Save.applescript
windowWaitUntil({windowName:manageWindowName, windowNameTest:"does not contain", whichWindow:"any", waitCycleDelaySeconds:waitCycleDelaySeconds, waitCycleMax:waitCycleMax})
fmGUI_ManageDataSources_Save.applescript
end fmGUI_ManageDataSources_Save
fmGUI_ManageDataSources_Save.applescript
on monthsAgo(m) -- returns a date formatted for the select box
export_timesheet copy.scpt
set m to -m
export_timesheet copy.scpt
set newDate to current date
export_timesheet copy.scpt
set {y, m} to {m div 12, m mod 12}
export_timesheet copy.scpt
if m < 0 then set {y, m} to {y - 1, m + 12}
export_timesheet copy.scpt
set newDate's year to (newDate's year) + y
export_timesheet copy.scpt
repeat m times
export_timesheet copy.scpt
if m is not 0 then tell newDate to set {day, day} to {32, day}
export_timesheet copy.scpt
return (the month of newDate & " " & the year of newDate) as text
export_timesheet copy.scpt
end monthsAgo
export_timesheet copy.scpt
on replace_chars(this_text, search_string, replacement_string)
export_timesheet copy.scpt
set monthList to {monthsAgo(0), monthsAgo(1), monthsAgo(2), monthsAgo(3), monthsAgo(4), monthsAgo(5)}
export_timesheet copy.scpt
set selected_month to choose from list monthList with prompt "Select the month to export: " OK button name "Continue" cancel button name "Cancel"
export_timesheet copy.scpt
if selected_month is false then return
export_timesheet copy.scpt
set startDate to date ("1 " & selected_month)
export_timesheet copy.scpt
copy startDate to endDate
export_timesheet copy.scpt
tell endDate to set {day, day} to {32, day}
export_timesheet copy.scpt
set fileName to (the year of startDate & "-" & (the month of startDate as integer) & "_timesheet.csv") as text
export_timesheet copy.scpt
tell application "Calendar" to set calendarNames to the name of every calendar
export_timesheet copy.scpt
set calendar_name to choose from list calendarNames with prompt "Select the timesheet calendar: " OK button name "Continue" cancel button name "Cancel"
export_timesheet copy.scpt
if calendar_name is false then return
export_timesheet copy.scpt
set calendar_name to the first item of calendar_name
export_timesheet copy.scpt
set cal to first calendar whose name is calendar_name
export_timesheet copy.scpt
set selectedEvents to every event of cal whose start date ≥ startDate and end date < endDate
export_timesheet copy.scpt
set output to {}
export_timesheet copy.scpt
repeat with myEvent in selectedEvents
export_timesheet copy.scpt
set duration to (((end date of myEvent) - (start date of myEvent)) / 60) as integer
export_timesheet copy.scpt
set hours to duration div 60
export_timesheet copy.scpt
set days to hours div 24
export_timesheet copy.scpt
set hours to hours mod 24
export_timesheet copy.scpt
set minutes to duration mod 60
export_timesheet copy.scpt
set {year:y, month:m, day:d, hours:h, minutes:min} to the start date of myEvent
export_timesheet copy.scpt
tell (100000000 + (d * 1000000 + m * 10000 + y)) as string to text 2 thru 3 & "/" & text 4 thru 5 & "/" & text 6 thru 9
export_timesheet copy.scpt
set outputDate to the result
export_timesheet copy.scpt
tell (10000 + (h * 100 + min)) as string to text 2 thru 3 & ":" & text 4 thru 5 & ":00"
export_timesheet copy.scpt
set outputTime to the result
export_timesheet copy.scpt
tell (1000000 + (days * 10000 + hours * 100 + minutes)) as string to text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7
export_timesheet copy.scpt