text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
on runAnnotationQuery(sql)
|
iBooks_to_Evernote.scpt
|
set annotations_result to runQuery(sql, annotations_db)
|
iBooks_to_Evernote.scpt
|
return annotations_result
|
iBooks_to_Evernote.scpt
|
end runAnnotationQuery
|
iBooks_to_Evernote.scpt
|
on runQuery(sql, db_location)
|
iBooks_to_Evernote.scpt
|
log "--- SQL QUERY: " & sql
|
iBooks_to_Evernote.scpt
|
set head to "sqlite3 " & db_location & space
|
iBooks_to_Evernote.scpt
|
set sqlite_command to head & quote & sql & quote
|
iBooks_to_Evernote.scpt
|
set retval to do shell script sqlite_command
|
iBooks_to_Evernote.scpt
|
log "--- SQL RESULT: " & retval
|
iBooks_to_Evernote.scpt
|
log "--- "
|
iBooks_to_Evernote.scpt
|
on checkNotebook(notebook_name)
|
iBooks_to_Evernote.scpt
|
set all_notebooks to every notebook
|
iBooks_to_Evernote.scpt
|
set notebook_exists to false
|
iBooks_to_Evernote.scpt
|
log "Looking for " & notebook_name
|
iBooks_to_Evernote.scpt
|
repeat with current_noteBook in all_notebooks
|
iBooks_to_Evernote.scpt
|
set current_name to (the name of current_noteBook)
|
iBooks_to_Evernote.scpt
|
if current_name is equal to notebook_name then
|
iBooks_to_Evernote.scpt
|
set notebook_exists to true
|
iBooks_to_Evernote.scpt
|
if notebook_exists then
|
iBooks_to_Evernote.scpt
|
log "Found notebook: " & notebook_name
|
iBooks_to_Evernote.scpt
|
log "Creating notebook: " & notebook_name
|
iBooks_to_Evernote.scpt
|
create notebook notebook_name
|
iBooks_to_Evernote.scpt
|
end checkNotebook
|
iBooks_to_Evernote.scpt
|
on getXWords(text_to_process, target_number)
|
iBooks_to_Evernote.scpt
|
set {old_tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, space}
|
iBooks_to_Evernote.scpt
|
set retval to words 1 thru target_number of text_to_process as string
|
iBooks_to_Evernote.scpt
|
set AppleScript's text item delimiters to old_tid
|
iBooks_to_Evernote.scpt
|
end getXWords
|
iBooks_to_Evernote.scpt
|
set checkSum to the text returned of (display dialog "Paste SHA1" default answer "" with title fileName)
|
sha1.applescript
|
set checkSumResult to first word of (do shell script "/usr/bin/openssl dgst -sha1 " & quoted form of POSIX path of chosenFile & " | awk '{print $2}'")
|
sha1.applescript
|
display dialog displayText & "SHA1 OK!" buttons {"OK"} default button "OK" with title fileName
|
sha1.applescript
|
display dialog displayText & "NB! No SHA1 match!" buttons {"CANCEL"} default button "CANCEL" with title fileName with icon caution
|
sha1.applescript
|
set currentSong to "No Detectable Music Playing"
|
current_song.scpt
|
if application "Google Play Music Desktop Player" is running then
|
current_song.scpt
|
set tempSong to do shell script "/usr/local/bin/jq -r '.song.artist + \" - \" + .song.title' ~/Library/Application\\ Support/Google\\ Play\\ Music\\ Desktop\\ Player/json_store/playback.json"
|
current_song.scpt
|
if tempSong is not " - " then
|
current_song.scpt
|
set currentSong to tempSong
|
current_song.scpt
|
if application "Firefox" is running then
|
current_song.scpt
|
set tempTitle to (name of win as string)
|
current_song.scpt
|
set tempSong to my playSearch(tempTitle, "")
|
current_song.scpt
|
if tempSong is not "no match" then
|
current_song.scpt
|
set tempTitle to (title of t as string)
|
current_song.scpt
|
set tempUrl to (URL of t as string)
|
current_song.scpt
|
set tempSong to my playSearch(tempTitle, tempUrl)
|
current_song.scpt
|
set tempTitle to (name of t as string)
|
current_song.scpt
|
set currentSong to (get artist of current track) & " - " & (get name of current track)
|
current_song.scpt
|
if application "VOX" is running then
|
current_song.scpt
|
tell application "VOX"
|
current_song.scpt
|
if player state is 1 then
|
current_song.scpt
|
set currentSong to (get artist) & " - " & (get track)
|
current_song.scpt
|
return currentSong
|
current_song.scpt
|
on playSearch(searchTitle, searchURL)
|
current_song.scpt
|
if searchTitle begins with "►" then
|
current_song.scpt
|
return searchTitle
|
current_song.scpt
|
else if searchTitle begins with "▶" then
|
current_song.scpt
|
if searchURL is not "" then
|
current_song.scpt
|
if searchTitle contains " - YouTube" and searchURL contains "youtube" then
|
current_song.scpt
|
else if searchTitle contains " by " and searchURL contains "soundcloud" then
|
current_song.scpt
|
else if searchTitle contains " · " and searchURL contains "spotify" then
|
current_song.scpt
|
else if searchTitle starts with "SomaFM Player" and searchURL contains "somafm" then
|
current_song.scpt
|
if searchTitle contains " - YouTube" then
|
current_song.scpt
|
else if searchTitle contains " by " then
|
current_song.scpt
|
else if searchTitle contains " · " then
|
current_song.scpt
|
else if searchTitle starts with "SomaFM Player" then
|
current_song.scpt
|
return "no match"
|
current_song.scpt
|
end playSearch
|
current_song.scpt
|
global webhookurl
|
Drive Space Check.applescript
|
global computername
|
Drive Space Check.applescript
|
set webhookurl to "#####" --slack webhook here
|
Drive Space Check.applescript
|
set computername to "Control Room 2 Video Server"
|
Drive Space Check.applescript
|
spaceCheck("/Volumes/FG Tech Recordings", 40)
|
Drive Space Check.applescript
|
spaceCheck("/", 35)
|
Drive Space Check.applescript
|
on spaceCheck(volume, threshold)
|
Drive Space Check.applescript
|
set dSize to (do shell script "df -h '" & volume & "' | grep %") as text
|
Drive Space Check.applescript
|
set theCapacity to word 16 in dSize as number
|
Drive Space Check.applescript
|
set theRemaining to 100 - theCapacity
|
Drive Space Check.applescript
|
set jsonString to "{\"text\":\"" & computername & " - Free Space Remaining on " & volume & ": " & theRemaining & "%\"}"
|
Drive Space Check.applescript
|
set curl_command to "curl -X POST -H 'Content-type: application/json' --data '" & jsonString & "' " & webhookurl
|
Drive Space Check.applescript
|
if theRemaining is less than or equal to threshold then
|
Drive Space Check.applescript
|
do shell script curl_command
|
Drive Space Check.applescript
|
end spaceCheck
|
Drive Space Check.applescript
|
if the (count of input) is 1 then --normal usecase
|
copy path.applescript
|
set the clipboard to quoted form of POSIX path of input
|
copy path.applescript
|
set unixPathList to ""
|
copy path.applescript
|
repeat with macAlias in input
|
copy path.applescript
|
set unixPathList to unixPathList & quoted form of POSIX path of macAlias & " "
|
copy path.applescript
|
set the clipboard to unixPathList --ToDo: fix trailing space
|
copy path.applescript
|
if q type of originalCue is "Audio" then
|
Create fade in.applescript
|
my createFadein(originalCue)
|
Create fade in.applescript
|
else if q type of originalCue is "Group" then
|
Create fade in.applescript
|
on createFadein(theCue)
|
Create fade in.applescript
|
set theCueLevel to theCue getLevel row 0 column 0
|
Create fade in.applescript
|
theCue setLevel row 0 column 0 db -120
|
Create fade in.applescript
|
set thePreWait to pre wait of theCue
|
Create fade in.applescript
|
set pre wait of newCue to thePreWait
|
Create fade in.applescript
|
newCue setLevel row 0 column 0 db theCueLevel
|
Create fade in.applescript
|
set q name of newCue to "Fade in: " & q display name of theCue
|
Create fade in.applescript
|
end createFadein
|
Create fade in.applescript
|
set q name of fadeGroup to "Fade in: " & theCueName
|
Create fade in.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.