text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
do shell script ("mkdir -p" & space & the quoted form of pReadyFolder)
|
test_process_pdfs.applescript
|
do shell script ("mkdir -p" & space & the quoted form of pProcessedFolder)
|
test_process_pdfs.applescript
|
set vPdfsFolderAlias to (POSIX file (pPdfsFolder as string)) as alias
|
test_process_pdfs.applescript
|
set vReadyFolderAlias to (POSIX file (pReadyFolder as string)) as alias
|
test_process_pdfs.applescript
|
set vProcessedFolderAlias to (POSIX file (pProcessedFolder as string)) as alias
|
test_process_pdfs.applescript
|
set vFileNames to list folder vPdfsFolderAlias
|
test_process_pdfs.applescript
|
repeat with vFileName in vFileNames
|
test_process_pdfs.applescript
|
set vPdfFileAlias to (POSIX file (pPdfsFolder & vFileName)) as alias
|
test_process_pdfs.applescript
|
set vExtension to name extension of vPdfFileAlias
|
test_process_pdfs.applescript
|
set vTypeIdentifier to type identifier of vPdfFileAlias
|
test_process_pdfs.applescript
|
if vExtension is "pdf" or vTypeIdentifier ends with "pdf" then
|
test_process_pdfs.applescript
|
set vDocumentContents to my extractTextFromPdf(vPdfFileAlias)
|
test_process_pdfs.applescript
|
if vDocumentContents ≠ "" then
|
test_process_pdfs.applescript
|
set vDocumentName to first paragraph of vDocumentContents
|
test_process_pdfs.applescript
|
set vDocumentName to my sanitizeFileName(vDocumentName)
|
test_process_pdfs.applescript
|
if vDocumentName ≠ "" then
|
test_process_pdfs.applescript
|
set vProcessedFile to (vProcessedFolderAlias as string) & vDocumentName & ".txt"
|
test_process_pdfs.applescript
|
log vDocumentName
|
test_process_pdfs.applescript
|
log vProcessedFile
|
test_process_pdfs.applescript
|
set vDocument to make new text document at beginning with properties {text:vDocumentContents} initial save location vProcessedFile
|
test_process_pdfs.applescript
|
save vDocument
|
test_process_pdfs.applescript
|
apply text factory pPathToTextFactory to vDocument saving yes
|
test_process_pdfs.applescript
|
close vDocument
|
test_process_pdfs.applescript
|
move vPdfFileAlias to vReadyFolderAlias
|
test_process_pdfs.applescript
|
global SWITCHES
|
switch.applescript
|
on active(featureName)
|
switch.applescript
|
set theValue to SWITCHES's getValue(featureName)
|
switch.applescript
|
if theValue is "" or theValue is missing value then return false
|
switch.applescript
|
theValue
|
switch.applescript
|
end active
|
switch.applescript
|
on inactive(featureName)
|
switch.applescript
|
not active(featureName)
|
switch.applescript
|
end inactive
|
switch.applescript
|
on new(pFeatureName as text)
|
switch.applescript
|
script SwitchInstance
|
switch.applescript
|
property featureName : pFeatureName
|
switch.applescript
|
on active()
|
switch.applescript
|
on inactive()
|
switch.applescript
|
not active()
|
switch.applescript
|
on turnOn()
|
switch.applescript
|
setValue(true)
|
switch.applescript
|
end turnOn
|
switch.applescript
|
on toggle()
|
switch.applescript
|
setValue(not active())
|
switch.applescript
|
end toggle
|
switch.applescript
|
on turnOff()
|
switch.applescript
|
setValue(false)
|
switch.applescript
|
end turnOff
|
switch.applescript
|
on setValue(boolValue)
|
switch.applescript
|
SWITCHES's setValue(featureName, boolValue)
|
switch.applescript
|
set UT_KEY_MISSING to "$unit-test-missing"
|
switch.applescript
|
set UT_KEY_OFF to "$unit-test-off"
|
switch.applescript
|
set UT_KEY_ON to "$unit-test-on"
|
switch.applescript
|
script Hook
|
switch.applescript
|
on reinit()
|
switch.applescript
|
SWITCHES's deleteKey(UT_KEY_MISSING)
|
switch.applescript
|
SWITCHES's setValue(UT_KEY_OFF, false)
|
switch.applescript
|
SWITCHES's setValue(UT_KEY_ON, true)
|
switch.applescript
|
end reinit
|
switch.applescript
|
set Hook to result
|
switch.applescript
|
newMethod("active")
|
switch.applescript
|
Hook's reinit()
|
switch.applescript
|
set sutMissing to my new(UT_KEY_MISSING)
|
switch.applescript
|
set sutOff to my new(UT_KEY_OFF)
|
switch.applescript
|
set sutOn to my new(UT_KEY_ON)
|
switch.applescript
|
assertEqual(false, sutMissing's active(), "Non-existent flag name")
|
switch.applescript
|
assertEqual(false, sutOff's active(), "Unset flag")
|
switch.applescript
|
assertEqual(true, sutOn's active(), "Set flag")
|
switch.applescript
|
newMethod("inactive")
|
switch.applescript
|
assertEqual(true, sutMissing's inactive(), "Non-existent flag name")
|
switch.applescript
|
assertEqual(true, sutOff's inactive(), "Unset flag")
|
switch.applescript
|
assertEqual(false, sutOn's inactive(), "Set flag")
|
switch.applescript
|
newMethod("turnOn")
|
switch.applescript
|
sutMissing's turnOn()
|
switch.applescript
|
assertEqual(true, sutMissing's active(), "Non-existent turns on")
|
switch.applescript
|
sutOff's turnOn()
|
switch.applescript
|
assertEqual(true, sutOff's active(), "Off turns on")
|
switch.applescript
|
sutOn's turnOn()
|
switch.applescript
|
assertEqual(true, sutOn's active(), "On remains on")
|
switch.applescript
|
newMethod("turnOff")
|
switch.applescript
|
sutMissing's turnOff()
|
switch.applescript
|
assertEqual(false, sutMissing's active(), "Non-existent remains off")
|
switch.applescript
|
sutOff's turnOff()
|
switch.applescript
|
assertEqual(false, sutOff's active(), "Off remains off")
|
switch.applescript
|
sutOn's turnOff()
|
switch.applescript
|
assertEqual(false, sutOn's active(), "On turns off")
|
switch.applescript
|
newMethod("toggle")
|
switch.applescript
|
sutMissing's toggle()
|
switch.applescript
|
sutOff's toggle()
|
switch.applescript
|
sutOn's toggle()
|
switch.applescript
|
set logger to std's import("logger")'s new("switch")
|
switch.applescript
|
set SWITCHES to plutil's new("switches")
|
switch.applescript
|
set hkWin to null
|
cornerBottomRightTowards.applescript
|
if is hotkey window of win
|
cornerBottomRightTowards.applescript
|
set hkWin to win
|
cornerBottomRightTowards.applescript
|
if (hkWin is equal to null)
|
cornerBottomRightTowards.applescript
|
create hotkey window with profile "Hotkey Window"
|
cornerBottomRightTowards.applescript
|
toggle hotkey window hkWin
|
cornerBottomRightTowards.applescript
|
if argv is {} then
|
focus-emacs-frame.applescript
|
focusApp()
|
focus-emacs-frame.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.