text
stringlengths
0
15.7k
source
stringlengths
6
112
on start()
spot-test.applescript
set newCaseCount to count of cases
spot-test.applescript
set caseLabels to sessionPlist's getList("Case Labels")
spot-test.applescript
if caseLabels is missing value then set caseLabels to {}
spot-test.applescript
set _currentCaseCount to length of caseLabels
spot-test.applescript
set caseIdChanged to sessionPlist's getString("Case ID") is not equal to caseId
spot-test.applescript
set caseCountChanged to newCaseCount is not equal to _currentCaseCount
spot-test.applescript
set REINITIALIZE to caseIdChanged or caseCountChanged
spot-test.applescript
sessionPlist's setValue("Case Labels", cases)
spot-test.applescript
if REINITIALIZE is true then
spot-test.applescript
if caseIdChanged then
spot-test.applescript
sessionPlist's setValue("Case ID", caseId)
spot-test.applescript
sessionPlist's setValue("Current Case Index", 1)
spot-test.applescript
set my _valid to false
spot-test.applescript
tell speech to speak("Subject Changed, select desired case from menu and re-run")
spot-test.applescript
return {0, "Re-run recommended"}
spot-test.applescript
if newCaseCount is less than _currentCaseCount then
spot-test.applescript
sessionPlist's setValue("Current Case Index", newCaseCount)
spot-test.applescript
logger's warn("Number of cases reduced, running the last in the list")
spot-test.applescript
logger's warn("Number of cases increased, running the next new case")
spot-test.applescript
sessionPlist's setValue("Current Case Index", _currentCaseCount + 1)
spot-test.applescript
set _currentCase to sessionPlist's getInt("Current Case Index")
spot-test.applescript
if _currentCase is 0 then
spot-test.applescript
set _currentCase to 1
spot-test.applescript
sessionPlist's setValue("Current Case Index", _currentCase)
spot-test.applescript
set autoText to "M"
spot-test.applescript
if autoIncrement is true then set AutoText to "A"
spot-test.applescript
logger's infof("Running case: {}/{} ({}): {}", {_currentCase, _currentCaseCount, autoText, item _currentCase of cases})
spot-test.applescript
{_currentCase as integer, item _currentCase of cases}
spot-test.applescript
end start
spot-test.applescript
to setAutoIncrement(newValue)
spot-test.applescript
set incrementSwitch to switch's new("Auto Increment Case Index")
spot-test.applescript
incrementSwitch's setValue(newValue)
spot-test.applescript
end setAutoIncrement
spot-test.applescript
on finish()
spot-test.applescript
if my _valid is false then return
spot-test.applescript
if autoIncrement then
spot-test.applescript
sessionPlist's setValue("Current Case Index", _currentCase + 1)
spot-test.applescript
if _currentCase is greater than or equal to _currentCaseCount then
spot-test.applescript
logger's info("End reached, restarting to 1")
spot-test.applescript
end finish
spot-test.applescript
set autoIncrement of SpotTestCaseInstance to incrementSwitch's active()
spot-test.applescript
SpotTestCaseInstance
spot-test.applescript
set logger to std's import("logger")'s new("spot-test")
spot-test.applescript
tell scroll area 3 of splitter group 1 of window 1
BTT-runApplescriptShortcut.applescript
perform action "AXPress" of button "Compile / Test"
BTT-runApplescriptShortcut.applescript
perform action "AXPress" of button "Run Script"
BTT-runApplescriptShortcut.applescript
keystroke "s" using {command down}
BTT-runApplescriptShortcut.applescript
tell application "BetterTouchTool" to set_string_variable "customVariable2" to "false"
remember closed:open.applescript
tell application "BetterTouchTool" to set_string_variable "customVariable2" to "true"
remember closed:open.applescript
set todaysDate to do shell script "date +\"%B %-d, %Y\"" -- e.g. "February 25, 2018"
New%20Daily%20Note.applescript
set todaysDate to encodeText(todaysDate, false, false)
New%20Daily%20Note.applescript
set bearText to "#Daily Notes#
New%20Daily%20Note.applescript
set bearText to encodeText(bearText, true, false)
New%20Daily%20Note.applescript
set bearURL to "open \"bear://x-callback-url/create?title=" & todaysDate & "&text=" & bearText & "\""
New%20Daily%20Note.applescript
set bearText to "## Appointments and Meetings
New%20Daily%20Note.applescript
do shell script "open \"bear://x-callback-url/add-text?title=" & todaysDate & "&text=" & bearText & "\""
New%20Daily%20Note.applescript
set startDay to date (date string of ((current date)) & "at 12:00:00 AM" as string)
New%20Daily%20Note.applescript
set endDay to date (date string of ((current date)) & "at 11:59:59 PM" as string)
New%20Daily%20Note.applescript
set eventCount to 0
New%20Daily%20Note.applescript
set todaysEvents to ¬
New%20Daily%20Note.applescript
(every calendar event whose ¬
New%20Daily%20Note.applescript
(start time is greater than or equal to startDay and end time is less than endDay) or ¬
New%20Daily%20Note.applescript
(start time is less than or equal to startDay and end time is greater than endDay) or ¬
New%20Daily%20Note.applescript
(start time is greater than or equal to startDay and start time is less than endDay and end time is greater than or equal to endDay) or ¬
New%20Daily%20Note.applescript
(start time is greater than or equal to startDay and end time is greater than startDay and end time is less than or equal to endDay))
New%20Daily%20Note.applescript
set todaysEventsSorted to {}
New%20Daily%20Note.applescript
repeat (length of todaysEvents) times
New%20Daily%20Note.applescript
repeat with a from 1 to (length of todaysEvents)
New%20Daily%20Note.applescript
set theCurrentItem to item a of todaysEvents
New%20Daily%20Note.applescript
else if start time of theCurrentItem comes before start time of theLowItem then
New%20Daily%20Note.applescript
set end of todaysEventsSorted to theLowItem
New%20Daily%20Note.applescript
repeat with anEvent in todaysEventsSorted
New%20Daily%20Note.applescript
set eventSubject to subject of anEvent
New%20Daily%20Note.applescript
if eventSubject contains "\"" then
New%20Daily%20Note.applescript
set theCommand to "echo '" & eventSubject & "' | sed \"s/\\\"/'/g\""
New%20Daily%20Note.applescript
set eventSubject to do shell script theCommand
New%20Daily%20Note.applescript
if eventSubject contains "&" then
New%20Daily%20Note.applescript
set theCommand to "echo '" & eventSubject & "' | sed \"s/&/and/g\""
New%20Daily%20Note.applescript
set startEvent to start time of anEvent
New%20Daily%20Note.applescript
set startTime to (characters 1 through -7 of (time string of startEvent) as string) & " " & (characters -2 through -1 of (time string of startEvent) as string)
New%20Daily%20Note.applescript
set endEvent to end time of anEvent
New%20Daily%20Note.applescript
set endTime to (characters 1 through -7 of (time string of endEvent) as string) & " " & (characters -2 through -1 of (time string of endEvent) as string)
New%20Daily%20Note.applescript
if startTime = endTime then
New%20Daily%20Note.applescript
set bearText to "- " & eventSubject & " (All Day)" as string
New%20Daily%20Note.applescript
tell me to set bearText to encodeText(bearText, true, false)
New%20Daily%20Note.applescript
set bearText to "- " & eventSubject & " (" & startTime & " to " & endTime & ")" as string
New%20Daily%20Note.applescript
set eventCount to eventCount + 1
New%20Daily%20Note.applescript
if eventCount = 0 then
New%20Daily%20Note.applescript
set bearText to "No appointments or meetings for today"
New%20Daily%20Note.applescript
set bearText to return
New%20Daily%20Note.applescript
set bearText to "## Notes
New%20Daily%20Note.applescript
do shell script "open \"bear://x-callback-url/add-text?title=" & todaysDate & "&text=" & bearText & "&new_window=yes\""
New%20Daily%20Note.applescript
if error_number is –10006 then
Script 15-6.applescript
else if error_number is –15267 then
Script 15-6.applescript
else -- Report any other errors
Script 15-6.applescript
set username to "esahn" as string
sshfs_login.applescript
set hostname to "127.0.0.1" as string
sshfs_login.applescript
set portnumber to "6000" as string
sshfs_login.applescript
set volname to "next-dev"
sshfs_login.applescript