Automator & AppleScript #
For anyone who wants to learn this particular art, please read first:
Daring Fireball: The English-Likeness Monster
My OS version is macOS 10.15. Things may have changed in newer versions.
Copy link of file #
Type: Quick Action workflow
on run {input, parameters}
set thePath to POSIX path of input
set the clipboard to "file://" & thePath as text
end run
Copy path without quotation marks #
Type: Quick Action workflow
Source: MacOS Sequoia File Path Copy and Paste Working Awkwardly :MacOS
Just download the zip file, unzip, and double-click to install.
property UseTilde : true
property EscapePath : false
property DisplayPath : false
on run {input, parameters}
set homePath to the POSIX path of (the path to the home folder from the user domain)
set textList to ""
repeat with nextItem in input
set nextItem to the POSIX path of nextItem
if UseTilde then
set nextItem to my SearchReplace(nextItem, homePath, "~/")
end if
if EscapePath then
set nextItem to my SearchReplace(nextItem, " ", "\\ ")
set nextItem to my SearchReplace(nextItem, "(", "\\(")
set nextItem to my SearchReplace(nextItem, ")", "\\)")
end if
set textList to textList & nextItem
if the (count of input) > 1 then
set textList to textList & return
end if
end repeat
if DisplayPath then
tell application "System Events" to display alert "output" message textList
end if
set the clipboard to textList
end run
on SearchReplace(sourceStr, searchString, replaceString)
-- replace <searchString> with <replaceString> in <sourceStr>
set searchStr to (searchString as text)
set replaceStr to (replaceString as text)
set sourceStr to (sourceStr as text)
set saveDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to (searchString)
set theList to (every text item of sourceStr)
set AppleScript's text item delimiters to (replaceString)
set theString to theList as string
set AppleScript's text item delimiters to saveDelims
return theString
end SearchReplaceWord count #
Type: Service
Ref: How to Set Up a System-Wide Word Count Service on Your Mac - MacRumors
echo "Words: (-w)"
echo $1 | wc -w
echo "Bytes: (-c)"
echo $1 | wc -c
echo "Characters: (zh -m)"
echo $1 | LANG="zh_CN.UTF-8" wc -m
Make symlink #
PDF to images #
Ref: How to Convert Multiple Page PDF to JPG o… - Apple Community