first sorry for my bad english.
i have a script to resize main window value to custom window and validate buttons on toolbar when i click on it, but the validate function dont work please help me solve this problem. thanks.
script toolbarWindow
property parent : class "NSWindow"
property FinderView : missing value
property DockView : missing value
property AboutView : missing value
property UpdatesView : missing value
on switchView_(sender)
set tagNumber to tag of sender as real
if tagNumber is 10 then
set targetView to FinderView
else if tagNumber is 20 then
set targetView to DockView
else if tagNumber is 1 then
set targetView to AboutView
else if tagNumber is 3 then
set targetView to UpdatesView
end if
set contentView to contentView() of me
repeat with aView in subviews of contentView
tell aView to removeFromSuperview()
end repeat
set windowFrame to frame() of me
set newWindowFrame to frameRectForContentRect_(frame() of targetView) of me
set frameHeight to height of |size| of windowFrame - height of |size| of newWindowFrame
set x of origin of newWindowFrame to x of origin of windowFrame
set y of origin of newWindowFrame to y of origin of windowFrame + frameHeight
tell me to setFrame_display_animate_(newWindowFrame,1,1)
tell contentView to addSubview_(targetView)
end switchView_
on validateUserInterfaceItem_(anItem)
set theSel to anItem's tag() as text
--set theSel to anItem's action() as text
if theSel = "10" and contentView() is FinderView then
return false
else if theSel = "20" and contentView() is DockView then
return false
else if theSel = "1" and contentView() is AboutView then
return false
else if theSel = "3" and contentView() is UpdatesView then
return false
else
return true
end if
end validateUserInterfaceItem_
end script