text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
set findList to {} | ASDataDetector.applescript |
repeat with match in matches | ASDataDetector.applescript |
if match's resultType() is (current application's NSTextCheckingTypeLink) then | ASDataDetector.applescript |
set theURL to match's |URL|() | ASDataDetector.applescript |
set end of findList to ((theURL's |description|()) as text) | ASDataDetector.applescript |
else if match's resultType() is (current application's NSTextCheckingTypePhoneNumber) then | ASDataDetector.applescript |
set end of findList to (match's phoneNumber) as text | ASDataDetector.applescript |
else if match's resultType() is (current application's NSTextCheckingTypeDate) then | ASDataDetector.applescript |
set theDate to match's |date|() | ASDataDetector.applescript |
set end of findList to ((theDate's descriptionWithLocale:(NSLocale's currentLocale)) as text) | ASDataDetector.applescript |
else if match's resultType() is (current application's NSTextCheckingTypeAddress) then | ASDataDetector.applescript |
set theAddress to match's addressComponents() | ASDataDetector.applescript |
set end of findList to theAddress as record | ASDataDetector.applescript |
log ((match's |description|()) as text) | ASDataDetector.applescript |
return findList | ASDataDetector.applescript |
end detectData | ASDataDetector.applescript |
property scpTarget : "you@example.com:~/public_html/s" | add-new-item-sync.scpt |
property publicPath : "https://example.com/s/" | add-new-item-sync.scpt |
on adding folder items to this_folder after receiving theFiles | add-new-item-sync.scpt |
repeat with thisFile in theFiles | add-new-item-sync.scpt |
display notification fileName with title "Syncing File..." | add-new-item-sync.scpt |
set itemPath to the quoted form of the POSIX path of thisFile | add-new-item-sync.scpt |
do shell script ("scp " & itemPath & " " & scpTarget) | add-new-item-sync.scpt |
set publicURL to urlEncode(publicPath & fileName) | add-new-item-sync.scpt |
set the clipboard to {text:(publicURL), Unicode text:publicURL} | add-new-item-sync.scpt |
display notification fileName with title "Uploaded and copied URL" | add-new-item-sync.scpt |
on urlEncode(input) | add-new-item-sync.scpt |
tell current application's NSString to set rawUrl to stringWithString_(input) | add-new-item-sync.scpt |
property exportFileExtension : ".pdf" | notability_pdf_export.scpt |
property noteExportFlag : "📌" | notability_pdf_export.scpt |
property notabilityName : "Notability" | notability_pdf_export.scpt |
set outFolder to my FilepathToThisFolderAsString() & "out" | notability_pdf_export.scpt |
tell application notabilityName | notability_pdf_export.scpt |
my WaitUntilExists(window 1 of application process notabilityName) | notability_pdf_export.scpt |
set notabilityWindow to window 1 of application process notabilityName | notability_pdf_export.scpt |
tell process notabilityName | notability_pdf_export.scpt |
select (row 1 of outline 1 of scroll area 2 of window 1) | notability_pdf_export.scpt |
repeat with aRow in (every row of table 1 of scroll area 3 of notabilityWindow) | notability_pdf_export.scpt |
set currentNoteCategory to name of static text 1 of UI element 1 of aRow | notability_pdf_export.scpt |
set currentNoteName to name of static text 2 of UI element 1 of aRow | notability_pdf_export.scpt |
set currentNoteModDate to name of static text 3 of UI element of aRow | notability_pdf_export.scpt |
set currentNoteModDate to my CreateDateFromDatestring(currentNoteModDate as text) | notability_pdf_export.scpt |
if (currentNoteName contains noteExportFlag) then | notability_pdf_export.scpt |
set noteNameWithoutEmoji to text 1 thru -2 of currentNoteName | notability_pdf_export.scpt |
set outNoteFilename to noteNameWithoutEmoji & exportFileExtension | notability_pdf_export.scpt |
set outFolder to outFolder & "/" & currentNoteCategory | notability_pdf_export.scpt |
set outNoteFilepath to outFolder & "/" & outNoteFilename | notability_pdf_export.scpt |
do shell script "mkdir -p " & quoted form of outFolder | notability_pdf_export.scpt |
set noteFileExists to my FileExists(outNoteFilepath) | notability_pdf_export.scpt |
if noteFileExists then | notability_pdf_export.scpt |
tell application "System Events" to set lastLocalModDate to modification date of file outNoteFilepath | notability_pdf_export.scpt |
if lastLocalModDate ≥ currentNoteModDate then | notability_pdf_export.scpt |
exit repeat -- continue | notability_pdf_export.scpt |
select aRow | notability_pdf_export.scpt |
click menu item "PDF..." of menu 1 of menu item "Export As" of menu 1 of menu bar item "File" of menu bar 1 | notability_pdf_export.scpt |
set exportDialogWindow to window "Export" | notability_pdf_export.scpt |
my WaitUntilExists(exportDialogWindow) | notability_pdf_export.scpt |
tell (exportDialogWindow) | notability_pdf_export.scpt |
keystroke "g" using {command down, shift down} | notability_pdf_export.scpt |
my WaitUntilExists(sheet 1) | notability_pdf_export.scpt |
set value of combo box 1 to outFolder | notability_pdf_export.scpt |
click button "Go" | notability_pdf_export.scpt |
set value of text field 1 to outNoteFilename | notability_pdf_export.scpt |
repeat with aCheckbox in (every checkbox) | notability_pdf_export.scpt |
tell aCheckbox to if value is 1 then click | notability_pdf_export.scpt |
click button "Export" | notability_pdf_export.scpt |
tell application notabilityName to quit | notability_pdf_export.scpt |
return "Success" | notability_pdf_export.scpt |
return (exists file theFile) | notability_pdf_export.scpt |
on CreateDateFromDatestring(theString) | notability_pdf_export.scpt |
return date (do shell script "python3 " & my FilepathToThisFolderAsString() & "date_converter.py " & quoted form of theString) | notability_pdf_export.scpt |
end CreateDateFromDatestring | notability_pdf_export.scpt |
on FilepathToThisFolderAsString() | notability_pdf_export.scpt |
return POSIX path of (parent of (path to me) as string) | notability_pdf_export.scpt |
end FilepathToThisFolderAsString | notability_pdf_export.scpt |
on WaitUntilExists(theElement) | notability_pdf_export.scpt |
repeat until (exists theElement) | notability_pdf_export.scpt |
end WaitUntilExists | notability_pdf_export.scpt |
on openSoundPannel() | screencapture.applescript |
end openSoundPannel | screencapture.applescript |
on closeSoundPannel() | screencapture.applescript |
end closeSoundPannel | screencapture.applescript |
on selectAudioOutput(audiodevice) | screencapture.applescript |
if audiodevice is equal to "" | screencapture.applescript |
log "skip selectAudioOutput" | screencapture.applescript |
openSoundPannel() | screencapture.applescript |
set device to "" | screencapture.applescript |
click radio button "Output" | screencapture.applescript |
if audiodevice is equal to "default" | screencapture.applescript |
set device to value of text field 1 of row 1 of table 1 of scroll area 1 | screencapture.applescript |
set AudioOutputs to table 1 of scroll area 1 | screencapture.applescript |
repeat with Counter from 1 to (number of rows of AudioOutputs as integer) | screencapture.applescript |
if exists text field 1 of row Counter of AudioOutputs then | screencapture.applescript |
set currentdevice to value of text field 1 of row Counter of AudioOutputs as string | screencapture.applescript |
if currentdevice is equal to audiodevice then | screencapture.applescript |
set selected of row Counter of AudioOutputs to true | screencapture.applescript |
set device to currentdevice | screencapture.applescript |
closeSoundPannel() | screencapture.applescript |
log "selectAudioOutput: " & device | screencapture.applescript |
if device is equal to "" | screencapture.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.