Macos AppleScript中的Finder窗口设置-小错误

Macos AppleScript中的Finder窗口设置-小错误,macos,applescript,finder,Macos,Applescript,Finder,我正在使用Sal Soghoian的AppleScript 1-2-3书中的便利查找窗口设置脚本;效果很好,但如果我增加设置的两个窗口中第二个窗口的侧边栏宽度,则对更改没有响应-它保持在145;第一个窗口响应宽度更改注释 tell application "Finder" close every window -- first window open folder "Webclients" of folder "Documents" of home set toolbar visible of

我正在使用Sal Soghoian的AppleScript 1-2-3书中的便利查找窗口设置脚本;效果很好,但如果我增加设置的两个窗口中第二个窗口的侧边栏宽度,则对更改没有响应-它保持在145;第一个窗口响应宽度更改注释

tell application "Finder"
close every window
-- first window
open folder "Webclients" of folder "Documents" of home
set toolbar visible of the front Finder window to true
set the sidebar width of the front Finder window to 145
set the current view of the front Finder window to column view
set the bounds of the front Finder window to {16, 80, 550, 675}
-- second window
open folder "Documents" of home
set toolbar visible of the front Finder window to true
set the sidebar width of the front Finder window to 145
set the current view of the front Finder window to column view
set the bounds of front Finder window to {560, 80, 1000, 675}
select the last Finder window
end tell

我发现如果你增加你的第二个窗口的宽度,它会像预期的那样工作。例如,我使用{560,801500675}作为第二个窗口通知1500的边界。在这些边界上,边栏的宽度是正确的和可变的。所以这一定是和窗口宽度和苹果应用于Finder窗口的一些自动设置有关的影响。祝你好运。

首先设置窗口边界,然后增加侧边栏的宽度

-- second window
open folder "Documents" of home
set toolbar visible of the front Finder window to true
set the bounds of front Finder window to {560, 80, 1000, 675}
set the sidebar width of the front Finder window to 200
set the current view of the front Finder window to column view
select the last Finder window
end tell  
Finder侧边栏宽度相对于Finder窗口的宽度

tell application "Finder"
    get sidebar width of window 1
        --> 136 //maximum value
    get bounds of window 1
        --> {-1, 44, 327, 235}//327-136 =191
end tell

tell application "Finder"
    get sidebar width of window 1
        --> 563 //maximum value
    get bounds of window 1
        --> {-1, 44, 754, 235}//754-563=191
end tell
tell application "Finder"
    get sidebar width of window 1
        --> 843 //maximum value
    get bounds of window 1
        --> {-1, 44, 1034, 235}//1034 -843 =191
end tell