text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set myPortraitPath to (contents of pasteboard of dragInfo) | audiMate.applescript |
updatePortrait(myPortraitPath, "homeWindow") | audiMate.applescript |
on should select tab view item theObject tab view item tabViewItem | audiMate.applescript |
if the name of theObject is "homeTabView" then | audiMate.applescript |
if visible of progress indicator 1 of window "homeWindow" is true then | audiMate.applescript |
end should select tab view item | audiMate.applescript |
create window with profile "Screencast" | New Screencast iTerm Window.applescript |
set apiKey to "XXXXXXXXXXXXXXXXXXXXXXXXX" | WeatherActivation.applescript |
set location to "55555" | WeatherActivation.applescript |
set theURL to "https://api.weatherapi.com/v1/forecast.json?key=" & apiKey & "&q=" & location & "&days=1&aqi=no&alerts=no" | WeatherActivation.applescript |
set weather to fetch JSON from (theURL) | WeatherActivation.applescript |
set highTemp to (maxtemp_f of |day| of item 1 of forecastday of forecast of weather) as integer | WeatherActivation.applescript |
set lowTemp to (mintemp_f of |day| of item 1 of forecastday of forecast of weather) as integer | WeatherActivation.applescript |
set theProjects to every flattened project | WeatherActivation.applescript |
set projNote to note of curProject | WeatherActivation.applescript |
if projNote contains "<Activate>" then | WeatherActivation.applescript |
set projectTriggers to text ((offset of "<Activate>" in projNote) + 10) thru ((offset of "</Activate>" in projNote) - 1) of projNote | WeatherActivation.applescript |
set triggerFlag to my getTriggerFlag(projectTriggers, highTemp, lowTemp) | WeatherActivation.applescript |
if triggerFlag is true then | WeatherActivation.applescript |
set status of curProject to active status | WeatherActivation.applescript |
end if -- if note contains <Activate> | WeatherActivation.applescript |
if projNote contains "<Deactivate>" then | WeatherActivation.applescript |
set projectTriggers to text ((offset of "<Deactivate>" in projNote) + 12) thru ((offset of "</Deactivate>" in projNote) - 1) of projNote | WeatherActivation.applescript |
set status of curProject to on hold status | WeatherActivation.applescript |
end if -- if note contains <Deactivate> | WeatherActivation.applescript |
end repeat -- Project loop | WeatherActivation.applescript |
on getTriggerFlag(projectTriggers, highTemp, lowTemp) | WeatherActivation.applescript |
set AppleScript's text item delimiters to {";"} | WeatherActivation.applescript |
set weatherTriggers to every text item of projectTriggers | WeatherActivation.applescript |
set triggerFlag to true | WeatherActivation.applescript |
repeat with n from 1 to (length of weatherTriggers) - 1 | WeatherActivation.applescript |
set weatherTrigger to item n of weatherTriggers | WeatherActivation.applescript |
set triggerItems to every text item of weatherTrigger | WeatherActivation.applescript |
set triggerType to (my trim(item 1 of triggerItems)) as string | WeatherActivation.applescript |
set triggerValue to (my trim(item 2 of triggerItems)) as string | WeatherActivation.applescript |
if (text 1 thru 1 of triggerValue) is "-" then | WeatherActivation.applescript |
set firstIntLoc to 1 | WeatherActivation.applescript |
set intCheck to (text 1 thru 1 of triggerValue) as integer | WeatherActivation.applescript |
if (text 2 thru 2 of triggerValue) is "-" then | WeatherActivation.applescript |
set firstIntLoc to 2 | WeatherActivation.applescript |
set intCheck to (text 2 thru 2 of triggerValue) as integer | WeatherActivation.applescript |
if (text 3 thru 3 of triggerValue) is "-" then | WeatherActivation.applescript |
set firstIntLoc to 3 | WeatherActivation.applescript |
set intCheck to (text 3 thru 3 of triggerValue) as integer | WeatherActivation.applescript |
set triggerOperator to text 1 thru (firstIntLoc - 1) of triggerValue | WeatherActivation.applescript |
set triggerInt to (text firstIntLoc thru (length of triggerValue) of triggerValue) as integer | WeatherActivation.applescript |
set tempFlag to my activateProject(triggerType, triggerOperator, triggerInt, highTemp, lowTemp) | WeatherActivation.applescript |
if tempFlag is false then | WeatherActivation.applescript |
set triggerFlag to false | WeatherActivation.applescript |
end repeat -- weatherTrigger loop | WeatherActivation.applescript |
return triggerFlag | WeatherActivation.applescript |
end getTriggerFlag | WeatherActivation.applescript |
on activateProject(triggerType, triggerOperator, triggerInt, highTemp, lowTemp) | WeatherActivation.applescript |
if triggerType = "LowTemp" then | WeatherActivation.applescript |
set weatherData to lowTemp | WeatherActivation.applescript |
set dataCheck to my dataCheck(weatherData, triggerOperator, triggerInt) | WeatherActivation.applescript |
if triggerType = "HighTemp" then | WeatherActivation.applescript |
set weatherData to highTemp | WeatherActivation.applescript |
return dataCheck | WeatherActivation.applescript |
end activateProject | WeatherActivation.applescript |
on dataCheck(weatherData, triggerOperator, triggerInt) | WeatherActivation.applescript |
set dataPass to false | WeatherActivation.applescript |
if triggerOperator is "=" then | WeatherActivation.applescript |
if weatherData = triggerInt then | WeatherActivation.applescript |
set dataPass to true | WeatherActivation.applescript |
else if triggerOperator is "<" then | WeatherActivation.applescript |
if weatherData is less than triggerInt then | WeatherActivation.applescript |
else if triggerOperator is ">" then | WeatherActivation.applescript |
if weatherData is greater than triggerInt then | WeatherActivation.applescript |
else if triggerOperator is "<=" then | WeatherActivation.applescript |
if weatherData is less than or equal to triggerInt then | WeatherActivation.applescript |
else if triggerOperator is ">=" then | WeatherActivation.applescript |
if weatherData is greater than or equal to triggerInt then | WeatherActivation.applescript |
else if triggerOperator = "<>" then | WeatherActivation.applescript |
if weatherData is not equal to triggerInt then | WeatherActivation.applescript |
return dataPass | WeatherActivation.applescript |
end dataCheck | WeatherActivation.applescript |
set newText to text items of someText | WeatherActivation.applescript |
set someText to newText as text | WeatherActivation.applescript |
set dr to display dialog "Glob pattern:" default answer "" buttons {"Cancel", "Add Matches", "Select Matches"} default button 3 cancel button 1 with title pwd giving up after 60 | lselect.applescript |
tell me to set matches to do shell script ("/bin/ls -d " & quoted form of pwd & query) | lselect.applescript |
set my_dialog to (display dialog "Search for:" default answer "Enter search term" buttons {"Cancel", "Search All", "Search Remaining"} default button "Search Remaining") | SearchOmniFocus.applescript |
set search_perspective to button returned of my_dialog | SearchOmniFocus.applescript |
set search_text to text returned of my_dialog | SearchOmniFocus.applescript |
tell application id "com.omnigroup.omnifocus2" | SearchOmniFocus.applescript |
tell first document window | SearchOmniFocus.applescript |
set perspective name to search_perspective | SearchOmniFocus.applescript |
set search term to search_text | SearchOmniFocus.applescript |
set position to {80, 60} | resize_windows_02 copy.applescript |
property templateFileName : "Code.md" | Create note for code.applescript |
if is_app_running "ColorSnapper2" then | optimised app-open check.applescript |
return " " | optimised app-open check.applescript |
if not versionCompare("1", "=", "1") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.0", "=", "1.0") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.1", "≠", "1.0") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.1", "!=", "1.0") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.1", ">", "1.0") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.0", "<", "1.9") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.0", "≤", "1.9") then error "Test failed" | versionCompare.applescript |
if not versionCompare("1.9", "≤", "1.9") then error "Test failed" | versionCompare.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.