text
stringlengths
0
15.7k
source
stringlengths
6
112
if x is not 0 then set newChar to character x of the to_chars
TextModifier.applescript
set newText to newText & newChar
TextModifier.applescript
return the newText
TextModifier.applescript
end translate_chars
TextModifier.applescript
set currentSelection to my getSelection()
selection_to_omnifocus.applescript
set taskName to my reReplace("^([-* ]|\\[|\\])+", "", currentSelection's |text|)
selection_to_omnifocus.applescript
set taskNote to currentSelection's |url|
selection_to_omnifocus.applescript
if taskNote is missing value then
selection_to_omnifocus.applescript
set taskNote to ""
selection_to_omnifocus.applescript
set theTask to make new inbox task with properties {name:taskName}
selection_to_omnifocus.applescript
set theTaskUrl to "omnifocus:///task/" & (id of theTask)
selection_to_omnifocus.applescript
my clipTextAndHtml(taskName, "<a href=\"" & theTaskUrl & "\">" & taskName & "</a>")
selection_to_omnifocus.applescript
my pasteToFrontmostApp()
selection_to_omnifocus.applescript
set noteId to item 1 of my getSelectedNoteIds()
selection_to_omnifocus.applescript
set noteName to name of note id noteId
selection_to_omnifocus.applescript
set noteUri to (my getNoteUri(noteId))
selection_to_omnifocus.applescript
set theTask's note to taskNote & "\n\n" & (noteUri's shortcutsScheme)
selection_to_omnifocus.applescript
tell application "Hook"
selection_to_omnifocus.applescript
set theNoteHook to make new bookmark with properties {address:(noteUri's hookScheme), name:noteName, path:""}
selection_to_omnifocus.applescript
set theTaskHook to make new bookmark with properties {address:theTaskUrl, name:taskName, path:""}
selection_to_omnifocus.applescript
hook theNoteHook and theTaskHook
selection_to_omnifocus.applescript
set theClipboard to the clipboard
Clean Books Copy Clipboard.applescript
set theEditedClipboard to paragraphs 1 thru -2 of theClipboard as string
Clean Books Copy Clipboard.applescript
set theEditedClipboard to text 1 thru -2 of theEditedClipboard as string
Clean Books Copy Clipboard.applescript
set theEditedClipboard to text 2 thru -1 of theEditedClipboard as string
Clean Books Copy Clipboard.applescript
set the clipboard to theEditedClipboard
Clean Books Copy Clipboard.applescript
set destinationFolder to "[INSERT DESTINATION FOLDER HERE]"
export_mail.scpt
repeat with msg in (get selection)
export_mail.scpt
set messageId to id of msg
export_mail.scpt
set sourceFolder to POSIX path of (account directory of account of mailbox of msg as rich text)
export_mail.scpt
set findCommand to "find " & quoted form of sourceFolder & " -name \"" & messageId & ".eml\" " & " -o -name \"" & messageId & ".emlx\""
export_mail.scpt
set sourceFile to do shell script findCommand
export_mail.scpt
set theName to last item of text items of sourceFile
export_mail.scpt
set destinationFile to destinationFolder & theName
export_mail.scpt
do shell script "cp -i " & quoted form of sourceFile & " " & quoted form of destinationFile
export_mail.scpt
tell front window of application "OmniFocus"
Copy Item URL.scpt
set theTrees to selected trees of content
Copy Item URL.scpt
if (count of theTrees) < 1 then
Copy Item URL.scpt
set theTrees to selected trees of sidebar
Copy Item URL.scpt
set theSelection to value of item 1 of theTrees
Copy Item URL.scpt
if class of theSelection is folder then
Copy Item URL.scpt
set the clipboard to "omnifocus:///folder/" & id of theSelection
Copy Item URL.scpt
else if class of theSelection is project then
Copy Item URL.scpt
set the clipboard to "omnifocus:///project/" & id of theSelection
Copy Item URL.scpt
set the clipboard to "omnifocus:///task/" & id of theSelection
Copy Item URL.scpt
doIt()
Copy Title copy.applescript
on doIt()
Copy Title copy.applescript
set the clipboard to title of active tab of window 1 as string
Copy Title copy.applescript
end doIt
Copy Title copy.applescript
set wins to windows
copy open folders.applescript
set the clipboard to (((count wins) as text) & " open windows" & return)
copy open folders.applescript
repeat with w in wins
copy open folders.applescript
set thePath to (POSIX path of (target of w as text)) -- gets the text version of the path to the folder
copy open folders.applescript
set theEntry to "- [" & (name of w) & "](file://" & thePath & ")"
copy open folders.applescript
set the clipboard to (the clipboard) & return & theEntry
copy open folders.applescript
on new_file(filename)
set-icon.applescript
global API
set-icon.applescript
if (is_exists(filename) of filesystem of API) = false then
set-icon.applescript
return make new property list file with properties {contents:make new property list item with properties {kind:record}, name:filename}
set-icon.applescript
end new_file
set-icon.applescript
on get_key(filename, key_name)
set-icon.applescript
tell property list file filename
set-icon.applescript
return property list item key_name
set-icon.applescript
end get_key
set-icon.applescript
on is_exists(filename, key_name)
set-icon.applescript
set key_value to value of property list item key_name
set-icon.applescript
end is_exists
set-icon.applescript
on new_item(filename, key_name, key_value) # set key value
set-icon.applescript
if is_exists(filename, key_name) = false then
set-icon.applescript
make new property list item at end of property list items of contents with properties {kind:number, name:key_name, value:key_value}
set-icon.applescript
end new_item
set-icon.applescript
on get_value(filename, key_name) # return key value
set-icon.applescript
if is_exists(filename) of filesystem of API then # file is exists
set-icon.applescript
if is_exists(filename, key_name) then
set-icon.applescript
return value of get_key(filename, key_name)
set-icon.applescript
end get_value
set-icon.applescript
on set_value(filename, key_name, key_value) # set key value
set-icon.applescript
new_file(filename)
set-icon.applescript
set clss to get class of key_value
set-icon.applescript
if clss = integer or clss = number then
set-icon.applescript
set clss to number
set-icon.applescript
set key_value to key_value as number
set-icon.applescript
if clss = string or clss = text then
set-icon.applescript
set clss to string
set-icon.applescript
if clss is in {boolean, date, list, number, real, record, string} then
set-icon.applescript
if is_exists(filename, key_name) then # key is exists
set-icon.applescript
set value of property list item key_name to key_value
set-icon.applescript
return key_value
set-icon.applescript
new_item(filename, key_name, key_value)
set-icon.applescript
error "bad plist key type (" & clss & "). allowed are boolean, date, list, number, record, string"
set-icon.applescript
end set_value
set-icon.applescript
set API to load script POSIX path of (path to home folder) & "/Library/Scripts/API/init.scpt"
set-icon.applescript
tell API to run
set-icon.applescript
set filename to POSIX path of (path to home folder) & "test.plist"
set-icon.applescript
rm(filename) of filesystem of API
set-icon.applescript
set_value("/Users/user/git/mac-os-github-notifier/mac-os-github-notifier.plist", "updated", date2unixtime(current date) of datetime of API)
set-icon.applescript
on queryChatGPT(query, openAIKey)
QueryChatGPT.scpt
global theResult
QueryChatGPT.scpt
set APIEndpoint to "https://api.openai.com/v1/chat/completions"
QueryChatGPT.scpt
set theURL to ca's NSURL's URLWithString:APIEndpoint
QueryChatGPT.scpt