Script Debugger Hangs Calling another Script

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

I presume you mean SD when you say SB.

When you run a script in Script Debugger, that script is in window 1. Are you trying to make the script address its own window while running?

Correct its Script Debugger. My problem is I write a script in SD like this

my testcall()

on testcall()
display dialog “Hello call”
end testcall

Then if I call it from another script in SD instead of running it opens the script with a yellow bar near the top and hangs SD. Whereas if I write the script in Script Editor and then call it from a script in SD it works fine. Hope that makes sense.

I’m having difficulty reproducing the problem you are experiencing. Here’s a animated gif of my invoking your test handler (a) from another Script Debugger window and (b) from another application (Script Editor):

ScreenFlow

Thank you for getting back to me. However problem it turns out is because I saved the file with “debugging” turned on. That tip from robertfern at MacScripter. I had thought files with the debug logo just indicated they had been written in “Script Debugger”, but as I now know they show the script had been saved with debugging turned on.