text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
if my waitNextWords then | speech.applescript |
say textToSpeak | speech.applescript |
set my waitNextWords to false | speech.applescript |
else if my synchronous then | speech.applescript |
say textToSpeak without waiting until completion | speech.applescript |
return textToSpeak | speech.applescript |
end speak | speech.applescript |
on speakAndLog(rawText as text) | speech.applescript |
speak(rawText) | speech.applescript |
if synchronous then | speech.applescript |
set prefix to "S+ " | speech.applescript |
set prefix to "S* " | speech.applescript |
logger's info(prefix & rawText) | speech.applescript |
end speakAndLog | speech.applescript |
on speakSynchronously(rawText as text) | speech.applescript |
if logging then | speech.applescript |
set logger to std's import("logger")'s new("speech") -- bandaid | speech.applescript |
logger's info("S+ " & rawText) | speech.applescript |
set origState to synchronous | speech.applescript |
set synchronous to true | speech.applescript |
set synchronous to origState | speech.applescript |
end speakSynchronously | speech.applescript |
on speakSynchronouslyWithLogging(rawText as text) | speech.applescript |
logger's info(rawText) | speech.applescript |
speakSynchronously(rawText) | speech.applescript |
end speakSynchronouslyWithLogging | speech.applescript |
set my quiet to true | speech.applescript |
set actual101 to speak("2904") | speech.applescript |
set case101 to "Case 101: Happy scenario" | speech.applescript |
std's assert("2-9 0-4", actual101, case101) | speech.applescript |
set actual102 to speak("2906") | speech.applescript |
set case102 to "Case 102: Unrecognized text" | speech.applescript |
std's assert("2906", actual102, case102) | speech.applescript |
set actual103 to speak(2904) | speech.applescript |
set case103 to "Case 103: Numbers" | speech.applescript |
std's assert("2-9 0-4", actual103, case103) | speech.applescript |
set actual104 to speak("QA") | speech.applescript |
set case104 to "Case 104: Exact text match" | speech.applescript |
std's assert("Q-A", actual104, case104) | speech.applescript |
set actual105 to speak("The variable se is not defined") | speech.applescript |
set case105 to "Case 105: Inline text" | speech.applescript |
std's assert("The variable s-e is not defined", actual105, case105) | speech.applescript |
set actual105b to speak("The selenium is not defined") | speech.applescript |
set case105b to "Case 105b: Whole word selenium match" | speech.applescript |
std's assert("The selenium is not defined", actual105b, case105b) | speech.applescript |
set my quiet to false | speech.applescript |
set logger to std's import("logger")'s new("speech") | speech.applescript |
set TRANS_CONFIG to plutil's new("custom text-to-speech") | speech.applescript |
on traverse(myLayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set visible of myLayer to true | pixelmator-pro-layers-in-folders-export-to-images.scpt |
if ((class of myLayer as text) = "group layer") then | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set mySubLayers to (every layer of myLayer) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
repeat with sublayer in mySubLayers | pixelmator-pro-layers-in-folders-export-to-images.scpt |
if ((class of sublayer as text) = "group layer") then | pixelmator-pro-layers-in-folders-export-to-images.scpt |
my traverse(sublayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
my layerToExport(sublayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
my layerToExport(myLayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
on layerToExport(myLayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set p to myLayer | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set pathComponents to {} | pixelmator-pro-layers-in-folders-export-to-images.scpt |
repeat while p exists | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set visible of p to true | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set s to (name of p as text) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set beginning of the pathComponents to s | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set p to parent of p | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set prefix to my list2string(pathComponents, "_") | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set filename to prefix & ".jpg" | pixelmator-pro-layers-in-folders-export-to-images.scpt |
export for web the front document to file ((exportLocation as text) & filename) as JPEG with properties {compression factor:100} | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set visible of myLayer to false | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set visible of p to false | pixelmator-pro-layers-in-folders-export-to-images.scpt |
end layerToExport | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set exportLocation to choose folder with prompt "Please choose where you'd like to export the images:" | pixelmator-pro-layers-in-folders-export-to-images.scpt |
set visible of every layer to true | pixelmator-pro-layers-in-folders-export-to-images.scpt |
repeat with currentLayer in every layer | pixelmator-pro-layers-in-folders-export-to-images.scpt |
my traverse(currentLayer, exportLocation) | pixelmator-pro-layers-in-folders-export-to-images.scpt |
display notification " images have been successfully exported." with title "Pixelmator Pro" | pixelmator-pro-layers-in-folders-export-to-images.scpt |
to appleScriptPath(filePath) | LIB_Files.applescript |
return POSIX file (POSIX path of filePath) as text | LIB_Files.applescript |
end appleScriptPath | LIB_Files.applescript |
on updateLog(logEntry) | LIB_Files.applescript |
do shell script "TEXT=$(echo " & quoted form of logEntry & " ); echo \"`date '+%Y.%m.%d %H:%M:%S'` $TEXT\" >> ~/Desktop/error_log.txt" | LIB_Files.applescript |
end updateLog | LIB_Files.applescript |
on replaceLog(logEntry, logPath) | LIB_Files.applescript |
do shell script "TEXT=$(echo " & quoted form of logEntry & " );echo \"`date '+%Y.%m.%d %H:%M:%S'` | LIB_Files.applescript |
$TEXT\" > " & logPath | LIB_Files.applescript |
end replaceLog | LIB_Files.applescript |
to trimLinesRight(theText) | LIB_Files.applescript |
repeat while theText ends with return | LIB_Files.applescript |
set theText to theText's text 1 thru -2 | LIB_Files.applescript |
end trimLinesRight | LIB_Files.applescript |
to stripStartupDisk(thePath) | LIB_Files.applescript |
set pathText to thePath as text | LIB_Files.applescript |
set hdName to name of startup disk | LIB_Files.applescript |
set hdLen to length of hdName | LIB_Files.applescript |
if text 1 thru hdLen of pathText is equal to hdName then | LIB_Files.applescript |
set pathText to text (hdLen + 1) thru -1 of pathText | LIB_Files.applescript |
else if text 1 thru (hdLen + 1) of pathText is equal to ("/" & hdName) then | LIB_Files.applescript |
set pathText to text (hdLen + 2) thru -1 of pathText | LIB_Files.applescript |
return pathText | LIB_Files.applescript |
end stripStartupDisk | LIB_Files.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.