I have asked this question before and thought I had the answer but I was wrong.
My problem is that any script I write in SB and then try and call from another script in SB hangs and I have a yellow bar at the top of the SB window. The identical script written in Script Editor works when called form another script in SB.
This is the script in Script Editor called from SB.
--PosWindowsDivCap
--For testing Excel left half left display, (Finder top right, ScriptDebugger bottom half ) of left display , Safari whole of Right Display
my PosWindowsDivCap()
on PosWindowsDivCap()
tell application "Finder"
set WinB to get bounds of window of desktop
log WinB
set WinL to item 1 of WinB --Left
set WinT to item 2 of WinB --Top
set WinR to item 3 of WinB --Right
set WinB to item 4 of WinB --Bottom
end tell
if WinL < 0 then --WinL <0 then Menu Bar on Right Screen
tell application "Microsoft Excel" to set bounds of window 1 to {WinL, WinT, (WinL + WinR), WinB} --Whole left Display
tell application "Script Debugger" to set bounds of window 1 to {((WinL * -1) / 2), WinT, WinR, WinB} --Right half right Display
tell application "Safari" to set bounds of window 1 to {WinL + WinR, WinT, (WinR / 16) * 9, WinB} --Left Half Right Display
else --WinL =0 Menu bar on Left Screen
tell application "Microsoft Excel" to set bounds of window 1 to {WinL, WinT, (WinR / 2), WinB}
tell application "Script Debugger" to set bounds of window 1 to {(WinR / 4) * 3, WinT, WinR, WinB}
tell application "Safari" to set bounds of window 1 to {WinR / 2, WinT, (WinR / 6) * 5, WinB}
end if
end PosWindowsDivCap