├── Applications ├── Adobe After Effects 2025 │ └── Reveal Project in Finder.applescript ├── Cinema 4D │ └── Open Roben Kleene Palette.applescript ├── Finder │ ├── Copy AppleScript Paths.applescript │ ├── Copy URLs to Files.applescript │ ├── New File.applescript │ ├── New Image File From Clipboard.applescript │ └── New Today Folder.applescript ├── Firefox │ └── Copy Title.applescript ├── Live │ └── Open Max for Live User Directory.applescript ├── Max │ └── Open Ableton Max for Live User Directory.applescript ├── Numbers │ ├── Copy Current Date & Time.applescript │ ├── Copy Current Date.applescript │ └── Copy Current Time.applescript ├── Safari │ ├── Copy Markdown Link to Page.applescript │ ├── Copy Markdown Links to Tabs.applescript │ ├── Move URL to Google Chrome.applescript │ ├── Move URL to New Tab.applescript │ └── Open URL in Google Chrome.applescript └── Simulator │ ├── Open Data Folder for Currently Running App in Terminal.applescript │ ├── Open Data Folder for Currently Running App.applescript │ └── Type Clipboard Contents.applescript ├── Makefile └── README.md /Applications/Adobe After Effects 2025/Reveal Project in Finder.applescript: -------------------------------------------------------------------------------- 1 | tell application "Adobe After Effects 2025" 2 | DoScript "app.project.file.parent.execute()" 3 | end tell 4 | -------------------------------------------------------------------------------- /Applications/Cinema 4D/Open Roben Kleene Palette.applescript: -------------------------------------------------------------------------------- 1 | openFile() 2 | 3 | on openFile() 4 | set theFilePath to ((path to home folder) as string) & "Developer:Settings:Apps:Cinema 4D:robenkleene.l4d" 5 | set thePOSIXPath to the POSIX path of theFilePath 6 | set theCommand to "open " & quoted form of thePOSIXPath 7 | do shell script theCommand 8 | end openFile 9 | -------------------------------------------------------------------------------- /Applications/Finder/Copy AppleScript Paths.applescript: -------------------------------------------------------------------------------- 1 | try 2 | copyFilePaths() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on copyFilePaths() 12 | tell application "Finder" 13 | set theSelection to get selection as alias list 14 | set thePaths to "" 15 | if theSelection is {} then 16 | set thePaths to POSIX path of (target of front window as alias) 17 | else 18 | repeat with theAlias in theSelection 19 | set thePath to theAlias as text 20 | if thePaths as string is equal to "" then 21 | set thePaths to thePath 22 | else 23 | set thePaths to thePaths & " 24 | " & thePath 25 | end if 26 | end repeat 27 | end if 28 | 29 | set the clipboard to thePaths 30 | end tell 31 | end copyFilePaths 32 | -------------------------------------------------------------------------------- /Applications/Finder/Copy URLs to Files.applescript: -------------------------------------------------------------------------------- 1 | try 2 | copyURLsToFiles() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | 12 | on copyURLsToFiles() 13 | tell application "Finder" 14 | set theSelection to get selection as alias list 15 | set theURLs to "" 16 | if theSelection is {} then 17 | set theURLs to URL of (target of front window as alias) 18 | else 19 | repeat with theAlias in theSelection 20 | set theURL to URL of theAlias 21 | 22 | if theURLs as string is equal to "" then 23 | set theURLs to theURL 24 | else 25 | set theURLs to theURLs & " 26 | " & theURL 27 | end if 28 | end repeat 29 | end if 30 | set the clipboard to theURLs 31 | end tell 32 | end copyURLsToFiles 33 | -------------------------------------------------------------------------------- /Applications/Finder/New File.applescript: -------------------------------------------------------------------------------- 1 | try 2 | makeNewFile() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on makeNewFile() 12 | set theNewFileScript to "~/.bin/file_new -r" 13 | tell application "Finder" 14 | try 15 | set the theFolder to (folder of the front window) as alias 16 | on error 17 | set the theFolder to path to desktop folder as alias 18 | end try 19 | 20 | set theUnixPath to POSIX path of theFolder 21 | set theNewFilePath to do shell script theNewFileScript & " \"" & theUnixPath & "\"" 22 | 23 | set theNewFilePath to POSIX file theNewFilePath as string 24 | reveal theNewFilePath 25 | end tell 26 | end makeNewFile 27 | -------------------------------------------------------------------------------- /Applications/Finder/New Image File From Clipboard.applescript: -------------------------------------------------------------------------------- 1 | try 2 | makeNewFile() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on makeNewFile() 12 | set theNewFileScript to "~/.bin/file_new -p -i -r" 13 | tell application "Finder" 14 | try 15 | set the theFolder to (folder of the front window) as alias 16 | on error 17 | set the theFolder to path to desktop folder as alias 18 | end try 19 | 20 | set theUnixPath to POSIX path of theFolder 21 | set theNewFilePath to do shell script theNewFileScript & " \"" & theUnixPath & "\"" 22 | 23 | try 24 | set theFileDescriptor to open for access theNewFilePath with write permission 25 | set eof of theFileDescriptor to 0 26 | 27 | set theImage to the clipboard as «class PNGf» 28 | write theImage to theFileDescriptor 29 | close access theFileDescriptor 30 | 31 | set theNewFilePath to theFile as string 32 | reveal theNewFilePath 33 | on error 34 | try 35 | close access theNewFilePath 36 | end try 37 | end try 38 | end tell 39 | end makeNewFile 40 | -------------------------------------------------------------------------------- /Applications/Finder/New Today Folder.applescript: -------------------------------------------------------------------------------- 1 | try 2 | body() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on body() 12 | tell application "Finder" 13 | set currentDate to do shell script "date '+%Y-%m-%d'" 14 | if exists Finder window 1 then 15 | set targetFolder to target of Finder window 1 16 | else 17 | set targetFolder to desktop 18 | end if 19 | set newFolder to make new folder at targetFolder with properties {name:currentDate} 20 | reveal newFolder 21 | activate 22 | end tell 23 | end body 24 | -------------------------------------------------------------------------------- /Applications/Firefox/Copy Title.applescript: -------------------------------------------------------------------------------- 1 | tell application "Firefox" 2 | set theTitle to name of front window as string 3 | set the clipboard to theTitle 4 | end tell 5 | -------------------------------------------------------------------------------- /Applications/Live/Open Max for Live User Directory.applescript: -------------------------------------------------------------------------------- 1 | openDirectory() 2 | 3 | on openDirectory() 4 | set theFilePath to ((path to home folder) as string) & "Documents:Max 9:Max for Live Devices:" 5 | set thePOSIXPath to the POSIX path of theFilePath 6 | set theCommand to "open " & quoted form of thePOSIXPath 7 | do shell script theCommand 8 | end openDirectory 9 | -------------------------------------------------------------------------------- /Applications/Max/Open Ableton Max for Live User Directory.applescript: -------------------------------------------------------------------------------- 1 | openDirectory() 2 | 3 | on openDirectory() 4 | set theFilePath to ((path to home folder) as string) & "Documents:Max 9:Max for Live Devices:" 5 | set thePOSIXPath to the POSIX path of theFilePath 6 | set theCommand to "open " & quoted form of thePOSIXPath 7 | do shell script theCommand 8 | end openDirectory 9 | -------------------------------------------------------------------------------- /Applications/Numbers/Copy Current Date & Time.applescript: -------------------------------------------------------------------------------- 1 | set the clipboard to (current date) as string 2 | -------------------------------------------------------------------------------- /Applications/Numbers/Copy Current Date.applescript: -------------------------------------------------------------------------------- 1 | set the clipboard to date string of (current date) 2 | -------------------------------------------------------------------------------- /Applications/Numbers/Copy Current Time.applescript: -------------------------------------------------------------------------------- 1 | set the clipboard to time string of (current date) 2 | -------------------------------------------------------------------------------- /Applications/Safari/Copy Markdown Link to Page.applescript: -------------------------------------------------------------------------------- 1 | try 2 | copyMarkdownLinks() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on copyMarkdownLinks() 12 | tell application "Safari" 13 | set theTitle to name of front document as string 14 | set theURL to URL of front document as string 15 | end tell 16 | set theLink to "[" & theTitle & "]" & "(" & theURL & ")" 17 | set the clipboard to theLink 18 | end copyMarkdownLinks 19 | -------------------------------------------------------------------------------- /Applications/Safari/Copy Markdown Links to Tabs.applescript: -------------------------------------------------------------------------------- 1 | try 2 | copyMarkdownLinks() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on copyMarkdownLinks() 12 | tell application "Safari" 13 | set theTitles to the name of every tab of window 1 14 | set theURLs to the URL of every tab of window 1 15 | end tell 16 | set theResult to "" 17 | repeat with theIndex from 1 to count of theURLs 18 | set theTitle to item theIndex of theTitles 19 | set theURL to item theIndex of theURLs 20 | set theLink to "[" & theTitle & "]" & "(" & theURL & ")" 21 | set theResult to theResult & "- " & theLink & " 22 | " 23 | end repeat 24 | set the clipboard to theResult 25 | end copyMarkdownLinks 26 | -------------------------------------------------------------------------------- /Applications/Safari/Move URL to Google Chrome.applescript: -------------------------------------------------------------------------------- 1 | try 2 | openURLInBrave() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | display dialog "AppleScript encountered an error." & ¬ 6 | " Error Message: " & errMsg & " Number " & errNum 7 | end if 8 | end try 9 | 10 | on openURLInBrave() 11 | tell application "Safari" 12 | set theTab to current tab of window 1 13 | set theURL to URL of theTab 14 | close theTab 15 | end tell 16 | tell application "Google Chrome" 17 | make new window 18 | open location theURL 19 | activate 20 | end tell 21 | end openURLInBrave 22 | -------------------------------------------------------------------------------- /Applications/Safari/Move URL to New Tab.applescript: -------------------------------------------------------------------------------- 1 | try 2 | switchToNewTab() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on switchToNewTab() 12 | tell application "Safari" 13 | set theURL to URL of current tab of window 1 14 | tell window 1 to make new tab with properties {URL:theURL} 15 | end tell 16 | end switchToNewTab 17 | -------------------------------------------------------------------------------- /Applications/Safari/Open URL in Google Chrome.applescript: -------------------------------------------------------------------------------- 1 | try 2 | openURLInBrave() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | display dialog "AppleScript encountered an error." & ¬ 6 | " Error Message: " & errMsg & " Number " & errNum 7 | end if 8 | end try 9 | 10 | on openURLInBrave() 11 | tell application "Safari" 12 | set theURL to URL of current tab of window 1 13 | end tell 14 | tell application "Google Chrome" 15 | make new window 16 | open location theURL 17 | activate 18 | end tell 19 | end openURLInBrave 20 | -------------------------------------------------------------------------------- /Applications/Simulator/Open Data Folder for Currently Running App in Terminal.applescript: -------------------------------------------------------------------------------- 1 | try 2 | openDataFolder() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on openDataFolder() 12 | set theProcess to do shell script "ps ax | grep -E \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/.*/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }'" 13 | set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/data/Containers/Data/Application/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }' | head -n 1" 14 | if thePath is equal to "" then 15 | set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/\" | grep -v grep | awk '{ print $1 }' | head -n 1" 16 | end if 17 | tell application "Terminal" 18 | set theWindow to do script "" 19 | do script "cd " & quoted form of thePath in theWindow 20 | activate 21 | end tell 22 | end openDataFolder 23 | -------------------------------------------------------------------------------- /Applications/Simulator/Open Data Folder for Currently Running App.applescript: -------------------------------------------------------------------------------- 1 | try 2 | openDataFolder() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on openDataFolder() 12 | set theProcess to do shell script "ps ax | grep -E \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/.*/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }'" 13 | set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/data/Containers/Data/Application/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }' | head -n 1" 14 | if thePath is equal to "" then 15 | set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/\" | grep -v grep | awk '{ print $1 }' | head -n 1" 16 | end if 17 | do shell script "open " & thePath 18 | end openDataFolder 19 | -------------------------------------------------------------------------------- /Applications/Simulator/Type Clipboard Contents.applescript: -------------------------------------------------------------------------------- 1 | try 2 | typeClipboard() 3 | on error errMsg number errNum 4 | if errNum is not equal to -128 then 5 | activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu 6 | display dialog "AppleScript encountered an error." & ¬ 7 | " Error Message: " & errMsg & " Number " & errNum 8 | end if 9 | end try 10 | 11 | on typeClipboard() 12 | set theClipboard to the clipboard as text 13 | tell application "System Events" to keystroke theClipboard 14 | end typeClipboard 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: install compile compile_modified decompile setup 2 | 3 | SOURCE = $(shell pwd) 4 | SOURCE_EXT = applescript 5 | DESTINATION = ${HOME}/Library/Scripts 6 | DEST_EXT = scpt 7 | 8 | sync: delete compile 9 | 10 | delete: 11 | @find "$(DESTINATION)" -name "*.scpt" -type f -delete 12 | 13 | compile_modified: 14 | @git ls-files --modified --others -z '**/*.applescript' |\ 15 | while IFS= read -r -d '' file; do \ 16 | file_no_ext="$${file%.*}"; \ 17 | name="$${file_no_ext##*/}"; \ 18 | directory="$(DESTINATION)/$${file%/*}"; \ 19 | destination="$$directory/$$name.$(DEST_EXT)"; \ 20 | mkdir -p "$$directory" && \ 21 | osacompile -o "$$destination" "$$file"; \ 22 | done 23 | 24 | compile: 25 | @find . -type f -name '*.$(SOURCE_EXT)' -print0 |\ 26 | while IFS= read -r -d '' file; do \ 27 | file_no_ext="$${file%.*}"; \ 28 | name="$${file_no_ext##*/}"; \ 29 | directory="$(DESTINATION)/$${file%/*}"; \ 30 | destination="$$directory/$$name.$(DEST_EXT)"; \ 31 | mkdir -p "$$directory" && \ 32 | osacompile -o "$$destination" "$$file"; \ 33 | done 34 | 35 | decompile: 36 | @cd $(DESTINATION) && \ 37 | find . -type f -name '*.$(DEST_EXT)' -print0 |\ 38 | while IFS= read -r -d '' file; do \ 39 | file_no_ext="$${file%.*}"; \ 40 | name="$${file_no_ext##*/}"; \ 41 | directory="$(SOURCE)/$${file%/*}"; \ 42 | destination="$$directory/$$name.$(SOURCE_EXT)"; \ 43 | mkdir -p "$$directory" && \ 44 | osadecompile "$$file" > "$$destination"; \ 45 | sed -i '' -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' "$$destination"; \ 46 | done 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AppleScripts 2 | 3 | Generally AppleScripts should be used for application specific scripting, and Shortcuts should be used for global scripting. 4 | --------------------------------------------------------------------------------