gpt4 book ai didi

applescript - 使用Applescript通过特定的完整路径“讲述”特定的应用程序

转载 作者:行者123 更新时间:2023-12-03 13:18:48 26 4
gpt4 key购买 nike

我希望通过指定应用程序的完整路径来告诉应用程序“ xyz”。这是因为在不同位置,系统上可能有不同版本的应用程序,但名称相同。
如果可能的话?

最佳答案

你试过了吗?它可以与posix样式路径或mac样式路径一起使用,那么问题是什么?再简单不过了。

set posixCalculatorPath to "/Applications/Calculator.app"
set macCalculatorPath to (path to applications folder as text) & "Calculator.app"

tell application posixCalculatorPath to activate

delay 2

tell application "Calculator" to quit

delay 2

tell application macCalculatorPath to activate


您可能不知道怎么做的一件事是找到您要定位的应用程序的路径。我创建了一个发现 here的工具,如果您将其输入文件的路径,则它将把路径返回到可以打开该文件的所有应用程序。这样该结果将告诉您是否存在多个具有相同名称的应用程序,然后您可以选择使用哪个应用程序。

关于applescript - 使用Applescript通过特定的完整路径“讲述”特定的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6201122/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com