Came across this somewhere: "cdf" changes the current bash directory to the one open in Finder.<p><pre><code> cdf ()
{
currFolderPath=$( /usr/bin/osascript <<EOT
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
end tell
EOT
);
echo "cd to \"$currFolderPath\"";
cd "$currFolderPath"
}</code></pre>
It was a while back, but I think it was in applescript. I had set it up so if I pressed some modifier key twice it would toggle the F* keys allowing me to not have to press the Fn key. It was for acccessing game hotkeys (maybe StarCraft II). It worked for a while and after some system upgrade, it stopped working. I was never motivated enough to find out why.
Indirectly, yes, though I found myself disliking the AppleScript language, so turned to JXA which provides the same functionality in ECMAScript. I found this repo to be helpful for both languages:<p><a href="https://github.com/JXA-Cookbook/JXA-Cookbook" rel="nofollow">https://github.com/JXA-Cookbook/JXA-Cookbook</a><p>I know it’s not quite what you are asking, but I hope it provides some benefit.
Yes:<p>1. Before I ported my CV to LaTeX to fully automate assembly, I had an AppleScript that would export a CV generated in InDesign to PDF with certain settings.<p>2. I have a small AppleScript that toggles Dark Mode on Mohave.