TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Have you written or came across any useful AppleScript on MacOS

8 点作者 truth_seeker超过 6 年前

5 条评论

yesenadam超过 6 年前
Came across this somewhere: &quot;cdf&quot; changes the current bash directory to the one open in Finder.<p><pre><code> cdf () { currFolderPath=$( &#x2F;usr&#x2F;bin&#x2F;osascript &lt;&lt;EOT tell application &quot;Finder&quot; 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 &quot;cd to \&quot;$currFolderPath\&quot;&quot;; cd &quot;$currFolderPath&quot; }</code></pre>
sethammons超过 6 年前
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.
through超过 6 年前
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:&#x2F;&#x2F;github.com&#x2F;JXA-Cookbook&#x2F;JXA-Cookbook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JXA-Cookbook&#x2F;JXA-Cookbook</a><p>I know it’s not quite what you are asking, but I hope it provides some benefit.
Odenwaelder超过 6 年前
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.
atmosx超过 6 年前
I wrote one to connect and disconnect to all the corporate VPNs with Viscosity.