重新加载终端首选项。
我用plutil编辑了Plist。然后,我将其放置在/user/
中。我希望它在不重新启动应用程序的情况下更新设置。我该怎么做?使用默认值读取com.apple.terminal
似乎不会使更改生效。我在PLIST中添加了一个终端配置文件,并希望更改生效。
我尝试使用AppleScript进行导入配置文件,但长话短说,这不是100%。如果您存储窗口1,则在打开后立即延迟延误相同。
on run argv
set importScript to first item of argv
set flag to application "Terminal" is not running
tell application "Terminal"
open importScript
delay 1.0E-5
activate
if flag then close back window
do script "exit" in window 1
delay 0.5
close window 1
end tell
end run
I used plutil to edit the plist. then I placed in under /User/<myUsername>/Library/Preferences/com.apple.Terminal.plist
. I want it to update the settings without reboot the application. How do I do this? using defaults read com.apple.Terminal
doesn't seem to make the changes take effect. I added a terminal profile to the plist and want the changes to take effect.
I tried making an import profile with AppleScript but long story short it's not 100% possible. if you store window 1 so it's the same var in-between delays right after open it errors more times.
on run argv
set importScript to first item of argv
set flag to application "Terminal" is not running
tell application "Terminal"
open importScript
delay 1.0E-5
activate
if flag then close back window
do script "exit" in window 1
delay 0.5
close window 1
end tell
end run
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不需要编辑简单的苹果本。此的局限性在于您必须在终端配置文件中
_OTI_&lt; yourProfileID&gt;
默认标头中的标题,并在运行终端配置文件时更改标题,以防止在已运行的应用程序导入的同一配置文件时,以防止意外关闭。 applescript
closeme.applescript
,然后您可以使用此applescript调用配置文件
there is no need for editing plists just a simple AppleScript. the limitations of this are you must have
_oti_<yourProfileId>
in your terminal profile default header and change the title when running your terminal profile to prevent accidental closures when installing the same profile of an already running appimport.applescript
closeMe.applescript
and then you can call the profile using this AppleScript