重新启动苹果引起无限重新启动循环
来设置语音控制以重新启动Mac,
我试图通过运行AppleScript:告诉应用程序“系统事件”
重新启动
端
请告诉我将其设置为语音控制。我会说“重新启动Mac”,
但是这使我的Mac陷入了无限的重新启动循环!
不得不浪费脚本。
是否有其他不进入循环的苹果本的解决方案?简单地说“重新启动Mac”,然后将其重新启动就很棒。
I tried to set up Voice Control to restart my mac by running the applescript:
tell application "System Events"
restart
end tell
I set it up for voice control. I'd say "Restart the Mac"
However this put my mac into an infinite restart loop!
Had to trash the script.
Is there a solution to this problem with a different applescript that doesn't go into a loop? It would be great to simply say "Restart the Mac" and then presto it restarts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我每天使用语音控制而无需错误地重新启动我的计算机。
这些是我采取的步骤。
粘贴以下 applescript 代码中的新脚本编辑器文档,并将其保存为“ restart Computer.scpt”(不要将其保存到任何“启动项目”文件夹中
)当然,您可以在系统偏好中授予访问系统Event.App来控制计算机。
使用语音控制当前处于活动状态,在 finder 中选择新的“ RESTART Computer.scpt”文件,然后说命令“使此言语”。
然后,您应该看到这样的弹出窗口...
注意:在执行所有操作之前,您应该从系统首选项中的命令列表中删除已设置为重新启动计算机的任何先前的自定义命令。
作为附加的奖励,以下以下abvlescript代码将揭示将您所有自定义语音命令存储在Finder中的文件。不时备份此文件是一个好主意。还将此文件复制到其他计算机将允许您在该计算机上使用自定义命令。
I use Voice Control every day, without error, to restart my computer.
These are the steps I took.
Paste this following AppleScript code into a new Script Editor document and save it as "Restart Computer.scpt" (Don't save it to any "Startup Items" Folder)
Make sure you grant access in System Preferences for System Events.app to be allowed to control your computer.
With Voice Control currently active, select the new "Restart Computer.scpt" file in Finder, then speak the command "Make This Speakable".
You Should then see a pop-up window like this...
Just insert the voice command you want to use (I use "Restart Computer") and click Save.
Note: Before doing all of this, you should remove any previous custom commands you have set for restarting the computer, from your Commands list in System Preferences.
As an added bonus, this following AppleScript code will reveal the file which stores all of your custom voice commands, in Finder. It's a good idea to backup this file from time to time. Also copying this file to a different computer will allow you to use the custom commands on that computer.
我认为AppleScript不是最好的工具。在
系统首选项中→可访问性→语音控制
您可以启用Apple的内置语音命令系统,该系统应该在开箱即用。他们没有内置的重启命令,因此您必须创建一个命令,但这很容易。单击右下方的“命令...”按钮,然后单击左下方的“+”按钮,您可以选择实现它的几种方法。I don't think AppleScript is the best tool for this. In
System Preferences→Accessibility→Voice Control
you can enable Apple's built-in voice command system, which should work out-of-the-box. They don't have a built-in Restart command so you'll have to create one, but that's easy enough. Click the 'Commands...' button at the bottom right, then click the '+' button at the bottom left, and you can choose any of several ways of implementing it.使用重新启动脚本保存为应用程序 Simple 重新启动命令将输入无限重新启动循环。这是因为未保存的申请状态。
要解决此问题,请改用以下脚本应用程序:
With restarting script saved as application the simple restart command will enter into infinite reboot loop. This is because of unsaved state of application.
To solve this problem, use following script application instead: