Applescript 与macOS Sierra中的AppTranslocation相关的错误

Applescript 与macOS Sierra中的AppTranslocation相关的错误,applescript,macos-sierra,Applescript,Macos Sierra,马科斯塞拉的守门员似乎有点挑剔。无论如何,这导致我几年前做的一个小实用程序抛出了一个相当恼人的错误 由于我还没有时间深入了解Sierra的幕后变化,我不确定如何修复错误。是否有人有处理与应用程序易位相关的错误并修复这些错误的经验 代码和错误如下: 代码: tell application "Finder" set currentDir to POSIX path of ((container of (path to me)) as text) end tell set currentDir to

马科斯塞拉的守门员似乎有点挑剔。无论如何,这导致我几年前做的一个小实用程序抛出了一个相当恼人的错误

由于我还没有时间深入了解Sierra的幕后变化,我不确定如何修复错误。是否有人有处理与应用程序易位相关的错误并修复这些错误的经验

代码和错误如下:

代码

tell application "Finder"
set currentDir to POSIX path of ((container of (path to me)) as text)
end tell
set currentDir to quoted form of currentDir
set lib80211 to quoted form of "AirPort Utility 5.6.1 Launcher.app/Contents/Resources/Apple80211.framework/Versions/A/Apple80211"

do shell script "export DYLD_INSERT_LIBRARIES=" & currentDir & lib80211 & "
cd " & currentDir & "AirPort\\ Utility\\ 5.6.1.app/Contents/MacOS
./AirPort\\ Utility"
sh: line 1: cd: /private/var/folders/t4/7k5z832d2tjd4xpzvvq43n4m0000gn/T/AppTranslocation/23AF67A4-3DF7-4982-A1A3-B019CDACB4C2/dAirPort Utility 5.6.1.app/Contents/MacOS: No such file or directory
sh: line 2: ./AirPort Utility: No such file or directory (127)
错误

tell application "Finder"
set currentDir to POSIX path of ((container of (path to me)) as text)
end tell
set currentDir to quoted form of currentDir
set lib80211 to quoted form of "AirPort Utility 5.6.1 Launcher.app/Contents/Resources/Apple80211.framework/Versions/A/Apple80211"

do shell script "export DYLD_INSERT_LIBRARIES=" & currentDir & lib80211 & "
cd " & currentDir & "AirPort\\ Utility\\ 5.6.1.app/Contents/MacOS
./AirPort\\ Utility"
sh: line 1: cd: /private/var/folders/t4/7k5z832d2tjd4xpzvvq43n4m0000gn/T/AppTranslocation/23AF67A4-3DF7-4982-A1A3-B019CDACB4C2/dAirPort Utility 5.6.1.app/Contents/MacOS: No such file or directory
sh: line 2: ./AirPort Utility: No such file or directory (127)

您必须再次从开发人员网站下载Airport Utility Launcher,因为当您安装macOS Sierra时,它会删除Airport Utility 5.6.1。这就是您必须从网站下载整个文件夹的原因:


希望能有所帮助。

经过大量的尝试和错误(以及对macOS 10.12 Sierra中AppTranslocation如何工作的一些阅读),我发现了一个修复方法

本质上,您必须打开*.dmg,然后将内容移动到Finder中的其他文件夹。问题是:如果您同时移动这两个应用程序,AppTranslocation可能会“标记”它们(看起来是永久的),并在每次尝试启动其中一个*.app时继续运行;这似乎是一个bug,我打算向苹果公司报告

解决方案


重新下载*.dmg(如其他人所述)并将其中包含的两个文件一次移动到一个文件夹中(最好是实用程序,但取决于您希望它们驻留的位置)。完成此操作后,运行启动程序,一切都应该像以前一样工作。

在这种情况下,我是开发人员。不幸的是,我还没来得及研究Sierra的Gatekeeper发生了什么变化,所以我无法更新启动器。我想得到一个更新,这样一直在使用启动器的人就不会因为更新到Sierra而被冷落。我从一个time machine备份中检索了这2个文件,并且花了相当长的时间才让它工作,但是多亏了你的建议,我将文件移动了一点,最后它工作了!