【发布时间】:2015-01-29 23:59:09
【问题描述】:
我目前正在使用 applescript 在我的大学设置桌面的各种参数。到目前为止,我的脚本已成功更改桌面背景和停靠栏大小。
手头的问题是当我运行脚本时,大多数时候,桌面上的图标永远不会改变。
这是我编写的用于更改桌面图标大小和网格间距的脚本:
tell application "System Events"
set finderPrefsFile to property list file "~/Library/Preferences/com.apple.Finder.plist"
tell finderPrefsFile
tell property list item "DesktopViewSettings"
tell property list item "IconViewSettings"
set value of property list item "gridSpacing" to "100"
set value of property list item "iconSize" to "32"
set value of property list item "arrangeBy" to "none"
end tell
end tell
end tell
end tell
#Restart Finder for changes to take effect.
do shell script "killall Finder"
我应该如何更改脚本以使其始终有效(我希望最终与我的一些同学分享这个脚本)。
【问题讨论】:
标签: macos applescript osx-mountain-lion