text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
write " and this is the end!" to file_id starting at eof
|
Script 17-7.applescript
|
set noteId to item 1 of argv
|
link_note.applescript
|
set noteUrl to my getNoteUri(noteId)
|
link_note.applescript
|
my clipTextAndHtml(noteName, "<a href=\"" & (noteUrl's shortcutsScheme) & "\">" & noteName & "</a>")
|
link_note.applescript
|
my hookToActiveWindow(noteName, (noteUrl's hookScheme))
|
link_note.applescript
|
set aquit to false
|
Backwards2.applescript
|
repeat until aquit is true
|
Backwards2.applescript
|
tell application "Adium.app"
|
Backwards2.applescript
|
display dialog "Enter text:" default answer ""
|
Backwards2.applescript
|
set decrypted to text returned of result
|
Backwards2.applescript
|
if alength is 0 then
|
Backwards2.applescript
|
set aquit to true
|
Backwards2.applescript
|
display dialog "!Eyb"
|
Backwards2.applescript
|
if not (exists (document 1)) then
|
open-safari-at-localhost.applescript
|
my open_new_window()
|
open-safari-at-localhost.applescript
|
set the URL of document 1 to "http://localhost:8080"
|
open-safari-at-localhost.applescript
|
if (exists (URL of document 1)) then
|
open-safari-at-localhost.applescript
|
my open_new_tab()
|
open-safari-at-localhost.applescript
|
on open_new_window()
|
open-safari-at-localhost.applescript
|
end open_new_window
|
open-safari-at-localhost.applescript
|
on open_new_tab()
|
open-safari-at-localhost.applescript
|
end open_new_tab
|
open-safari-at-localhost.applescript
|
logger's info("Hello world")
|
hello-bundle.applescript
|
set interpolated to format {"hello: {}", {"world"}}
|
hello-bundle.applescript
|
logger's infof("interpolated: {}", interpolated)
|
hello-bundle.applescript
|
global GENERIC_RESULT_VAR
|
keyboard-maestro.applescript
|
set thisCaseId to "spotCheck-keyboard-maestro"
|
keyboard-maestro.applescript
|
Run Unit Tests
|
keyboard-maestro.applescript
|
Safari
|
keyboard-maestro.applescript
|
Manual: Run Macro
|
keyboard-maestro.applescript
|
Set/Get Variable
|
keyboard-maestro.applescript
|
sut's sendSafariText("KM Test")
|
keyboard-maestro.applescript
|
sut's runMacro("hello")
|
keyboard-maestro.applescript
|
sut's setVariable("from Script Editor Name", "from Script Editor Value 1")
|
keyboard-maestro.applescript
|
assertThat of std given condition:sut's getVariable("from Script Editor Name") is equal to "from Script Editor Value 1", messageOnFail:"Failed spot check"
|
keyboard-maestro.applescript
|
sut's setVariable("from Script Editor Name", "from Script Editor Value 2")
|
keyboard-maestro.applescript
|
assertThat of std given condition:sut's getVariable("from Script Editor Name") is equal to "from Script Editor Value 2", messageOnFail:"Failed spot check"
|
keyboard-maestro.applescript
|
script KeyboardMaestroInstance
|
keyboard-maestro.applescript
|
on createTriggerLink(scriptName, params)
|
keyboard-maestro.applescript
|
set encodedName to textUtil's encodeUrl(scriptName)
|
keyboard-maestro.applescript
|
set encodedParam to textUtil's encodeUrl(params)
|
keyboard-maestro.applescript
|
format {"kmtrigger://m={}&value={}", {encodedName, encodedParam}}
|
keyboard-maestro.applescript
|
end createTriggerLink
|
keyboard-maestro.applescript
|
on createReadableTriggerLink(scriptName, params)
|
keyboard-maestro.applescript
|
set plusName to textUtil's replace(scriptName, " ", "+")
|
keyboard-maestro.applescript
|
set plusParams to textUtil's replace(params, " ", "+")
|
keyboard-maestro.applescript
|
if scriptName contains "Open in QuickNote" then
|
keyboard-maestro.applescript
|
return format {"note://{}", {plusParams}}
|
keyboard-maestro.applescript
|
else if scriptName contains "Open in Sublime Text" then
|
keyboard-maestro.applescript
|
return format {"st://{}", {plusParams}}
|
keyboard-maestro.applescript
|
format {"kmt://m={}&value={}", {plusName, plusParams}}
|
keyboard-maestro.applescript
|
end createReadableTriggerLink
|
keyboard-maestro.applescript
|
on runMacro(macroName)
|
keyboard-maestro.applescript
|
do script macroName
|
keyboard-maestro.applescript
|
end runMacro
|
keyboard-maestro.applescript
|
on runScript(scriptName as text)
|
keyboard-maestro.applescript
|
setvariable "km_result" to "false"
|
keyboard-maestro.applescript
|
set runResult to (getvariable "km_result") is equal to "true"
|
keyboard-maestro.applescript
|
on fetchValue(scriptName)
|
keyboard-maestro.applescript
|
set run_result to (getvariable "km_result")
|
keyboard-maestro.applescript
|
run_result
|
keyboard-maestro.applescript
|
end fetchValue
|
keyboard-maestro.applescript
|
on sendSafariText(theText as text)
|
keyboard-maestro.applescript
|
setVariable("TypeText", theText)
|
keyboard-maestro.applescript
|
runScript("App Safari Send Text")
|
keyboard-maestro.applescript
|
end sendSafariText
|
keyboard-maestro.applescript
|
on sendSlackText(theText as text)
|
keyboard-maestro.applescript
|
if runScript("App Slack Prepare For Automation") is false then -- reduce the macro to simply check if input box is ready.
|
keyboard-maestro.applescript
|
set cq to std's import("command-queue")
|
keyboard-maestro.applescript
|
logger's info("Slack seems unready, registering command...")
|
keyboard-maestro.applescript
|
cq's add("slack-command", theText)
|
keyboard-maestro.applescript
|
if runScript("App Slack Send Text") is false then
|
keyboard-maestro.applescript
|
logger's warnf("Failed to send text: '{}', Slack may have a draft message", theText)
|
keyboard-maestro.applescript
|
if runScript("App Slack Click Send") is false then
|
keyboard-maestro.applescript
|
logger's debug("Failed to click the Slack send button")
|
keyboard-maestro.applescript
|
do script "App Slack Prepare For Automation"
|
keyboard-maestro.applescript
|
if (getvariable "automation_status" as text) is not "ready" then
|
keyboard-maestro.applescript
|
setvariable "TypeText" to theText
|
keyboard-maestro.applescript
|
do script "App Slack Send Text"
|
keyboard-maestro.applescript
|
delay 0.5 -- 0.2 fails intermittently. 0.3 failed on first morning run 0.4 failed TTW meeting.
|
keyboard-maestro.applescript
|
set hasEmoji to theText contains ":"
|
keyboard-maestro.applescript
|
if hasEmoji then delay 0.4 -- increment by 0.1 until it becomes more reliable.
|
keyboard-maestro.applescript
|
setvariable "TypeText" to return
|
keyboard-maestro.applescript
|
delay 0.5 -- Fix attempt.
|
keyboard-maestro.applescript
|
logger's debugf("Invoking: '{}'", "App Slack Click Send")
|
keyboard-maestro.applescript
|
do script "App Slack Click Send" -- To ensure send in case the above fails. Silently fails.
|
keyboard-maestro.applescript
|
end sendSlackText
|
keyboard-maestro.applescript
|
on getVariable(varName)
|
keyboard-maestro.applescript
|
tell application "Keyboard Maestro Engine" to getvariable varName
|
keyboard-maestro.applescript
|
end getVariable
|
keyboard-maestro.applescript
|
on setVariable(varName, newValue)
|
keyboard-maestro.applescript
|
tell application "Keyboard Maestro Engine" to setvariable varName to newValue
|
keyboard-maestro.applescript
|
end setVariable
|
keyboard-maestro.applescript
|
newMethod("createTriggerLink")
|
keyboard-maestro.applescript
|
assertEqual("kmtrigger://m=Open%20in%20QuickNote&value=Hello%20World", sut's createTriggerLink("Open in QuickNote", "hello world"), "With Parameter")
|
keyboard-maestro.applescript
|
set logger to std's import("logger")'s new("keyboard-maestro")
|
keyboard-maestro.applescript
|
set GENERIC_RESULT_VAR to "km_result"
|
keyboard-maestro.applescript
|
set job_titles to {"LLM", "Drs.", "MA", "MSc", "BSc", "BA", "Ir.", "Prof.dr.", "Prof.ir.", "Dr.ir.", "Dr.", "Dr. Ph.D.", "Ph.D.", "MSc BA", "BEc", "Drs. BEd", "Mr.", "Mr.drs."}
|
UpdateContacts.applescript
|
log company of this_contact as string
|
UpdateContacts.applescript
|
if (company of this_contact = "UU") then
|
UpdateContacts.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.