text
stringlengths
0
15.7k
source
stringlengths
6
112
set oNoteSel to item iNote of noteList
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
if oNoteSel ≠ "" then --- APPEND TO EXISTING NOTE ---
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
set noteTitle to title of oNoteSel
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
append oNoteSel html noteHTMLAppend
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
display dialog "HTML appended to Note: " & return & noteTitle
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
else --- CREATE NEW NOTE ---
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
set oNoteSel to create note with text noteContentStr title noteTitleToFind notebook nbName tags tagList
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
display dialog "NEW Note Created: " & return & noteTitleToFind
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
open note window with oNoteSel
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
on extractIndex(pList, pStartDelim, pEndDelim)
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
local itemSel, indexNum
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
set itemSel to item 1 of pList as text
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
set indexNum to (text ((offset of pStartDelim in itemSel) ¬
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
+ (length of pStartDelim)) thru ¬
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
((offset of pEndDelim in itemSel) - 1) of itemSel) as integer
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
return indexNum
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
end extractIndex
EN%20Mac%20Append%20Note%20OR%20Create%20New%20Note%20(AS).applescript
set infinite loop of eachCue to true
Turn on infinite loop.applescript
on updateLocation()
location.applescript
set myLoginEmail to (contents of text field "loginEmailInput")
location.applescript
set myLoginPassword to (contents of text field "loginPasswordInput")
location.applescript
set myLocation_cont to (contents of text view 1 of scroll view 1 of window "locationWindow") as string
location.applescript
set myLocationURL to (homeRootURL & "updateLocation.php") as string
location.applescript
set myLocation to ("curl --form-string " & quoted form of ("strDesc=" & myLocation_cont) & " --form-string " & quoted form of ("email=" & myLoginEmail) & " --form-string " & quoted form of ("password=" & myLoginPassword) & " --form press=OK" & " -e 'audiMate.updateLocation' " & quoted form of (myLocationURL))
location.applescript
set myLocation to (do shell script myLocation)
location.applescript
return myLocation_cont
location.applescript
end updateLocation
location.applescript
if the name of theObject is "locationHideButton" then
location.applescript
set title of window "homeWindow" to "Home"
location.applescript
close panel window "locationWindow"
location.applescript
else if the name of theObject is "locationUpdateButton" then
location.applescript
set myProfileData_location to updateLocation()
location.applescript
set contents of text field "homeLocationText" of window "homeWindow" to (myProfileData_location)
location.applescript
if the name of window 1 is "homeWindow" then
location.applescript
set finderPath to ""
compilesass.applescript
set finderPath to (target of front Finder window) as text
compilesass.applescript
set finderFolder to (folder of the front window as alias)
compilesass.applescript
set finderFolder to (path to home folder as alias)
compilesass.applescript
set finderPath to quoted form of POSIX path of finderFolder
compilesass.applescript
do script "sass --watch " & finderPath & "/styles/scss:" & finderPath & "styles --style compressed"
compilesass.applescript
set appName to (the name of every process whose frontmost is true) as string
zotpick-pandoc.applescript
display alert "Problem" message "Could not get the name of the frontmost application."
zotpick-pandoc.applescript
set zotRunning to do shell script "/usr/bin/curl 'http://localhost:23119/better-bibtex/cayw?probe=probe' 2>/dev/null; exit 0"
zotpick-pandoc.applescript
if zotRunning is "" then
zotpick-pandoc.applescript
display alert "Zotero not running" message "This script will not work unless Zotero is running. Please launch Zotero and try again"
zotpick-pandoc.applescript
tell application appName
zotpick-pandoc.applescript
else if zotRunning is "No endpoint found" then
zotpick-pandoc.applescript
display alert "Better BibTeX not installed" message "This script will not work unless Better BibTeX is installed. Please make sure that Better BibTeX is installed in the running instance of Zotero"
zotpick-pandoc.applescript
else if zotRunning is "ready" then
zotpick-pandoc.applescript
set theReference to do shell script "/usr/bin/curl 'http://localhost:23119/better-bibtex/cayw?format=pandoc' 2>/dev/null; exit 0"
zotpick-pandoc.applescript
repeat until application appName is frontmost
zotpick-pandoc.applescript
tell application appName to activate
zotpick-pandoc.applescript
display alert errMsg
zotpick-pandoc.applescript
keystroke theReference
zotpick-pandoc.applescript
fmGUI_ModeEnsure_Browse()
fmGUI_ModeEnsure_Browse.applescript
on fmGUI_ModeEnsure_Browse()
fmGUI_ModeEnsure_Browse.applescript
fmGUI_ModeSelect("Browse")
fmGUI_ModeEnsure_Browse.applescript
error "Couldn't ensure in Browse Mode - " & errMsg number errNum
fmGUI_ModeEnsure_Browse.applescript
end fmGUI_ModeEnsure_Browse
fmGUI_ModeEnsure_Browse.applescript
on fmGUI_ModeSelect(modeToSelect)
fmGUI_ModeEnsure_Browse.applescript
tell application "htcLib" to fmGUI_ModeSelect(modeToSelect)
fmGUI_ModeEnsure_Browse.applescript
end fmGUI_ModeSelect
fmGUI_ModeEnsure_Browse.applescript
set logPath to "/Users/alan/Documents/dev/scripts+tools/AppleScript logs/anki-reword-gender-log.txt"
ank-reword-gender-html.scpt
set commonScript to load script alias ((path to library folder from user domain as string) ¬
ank-reword-gender-html.scpt
& "Scripts:commonLog.scpt")
ank-reword-gender-html.scpt
set {originalDelimiters, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {", "}}
ank-reword-gender-html.scpt
set notes to the clipboard
ank-reword-gender-html.scpt
set wordItems to text items of notes
ank-reword-gender-html.scpt
my replace_matches(wordItems, "female", "feminine", false)
ank-reword-gender-html.scpt
my replace_matches(wordItems, "male", "masculine", false)
ank-reword-gender-html.scpt
set modifiedText to wordItems as text
ank-reword-gender-html.scpt
tell application "Anki"
ank-reword-gender-html.scpt
my openHTMLDialog()
ank-reword-gender-html.scpt
set pasteText to "<ul>
ank-reword-gender-html.scpt
<li>" & modifiedText & "</li>
ank-reword-gender-html.scpt
</ul>"
ank-reword-gender-html.scpt
set the clipboard to {text:(pasteText as string), Unicode text:pasteText}
ank-reword-gender-html.scpt
my closeHTMLDialog()
ank-reword-gender-html.scpt
set AppleScript's text item delimiters to originalDelimiters
ank-reword-gender-html.scpt
on replace_matches(this_list, match_item, replacement_item, replace_all)
ank-reword-gender-html.scpt
set this_item to item i of this_list
ank-reword-gender-html.scpt
if this_item is the match_item then
ank-reword-gender-html.scpt
set item i of this_list to the replacement_item
ank-reword-gender-html.scpt
if replace_all is false then return this_list
ank-reword-gender-html.scpt
return this_list
ank-reword-gender-html.scpt
end replace_matches
ank-reword-gender-html.scpt
on openHTMLDialog()
ank-reword-gender-html.scpt
keystroke "x" using {shift down, command down}
ank-reword-gender-html.scpt
end openHTMLDialog
ank-reword-gender-html.scpt
on closeHTMLDialog()
ank-reword-gender-html.scpt
tell process "Anki"
ank-reword-gender-html.scpt
click button 1 of window "HTML Editor"
ank-reword-gender-html.scpt
set myObj to "error"
ank-reword-gender-html.scpt
log_event((errStr as string), logPath) of commonScript
ank-reword-gender-html.scpt
end closeHTMLDialog
ank-reword-gender-html.scpt
set max to 3
menubarx-new-and-focus.applescript
tell application "MenubarX" to activate
menubarx-new-and-focus.applescript
tell process "MenubarX"
menubarx-new-and-focus.applescript
tell menu bar 2
menubarx-new-and-focus.applescript
set iconCount to (count of menu bar items)
menubarx-new-and-focus.applescript