Script Does not work in ScriptDebugger but does in Script Editor

I am trying to incorporate into a script positioning commands. On my computer I have installed “Magnet” which allows for the repositioning of open applications.

In script editor the script works as the title suggests but not in ScriptDebugger. the following script moves Excel to the left 2/3rds of the screen.

Looks like I am not the only one with this sort of issue

If you can give us an example script that illustrates the problem you are experiencing, preferable without involving Magnet, then we can take a look at try and figure out the cause of the problem.

Thank you very much for getting back to me, for what is worth I have found “Script Debugger” invaluable

My script does not have to call the application Magnet as it is loaded every time I start my machine.

So this is the script that works in “Script Editor” every time.

tell application "Microsoft Excel"
	activate
	tell application "System Events" to tell process "Microsoft Excel" to key code 14 using {control down, option down}
end tell

I noticed on the forum that some users had a problem with debugger turned on but that was not my problem. So the last thing I tried was inserting a delay and so far this seems to have worked. This is the script I am running in “Script Debugger” as you can. see with a delay of 1/10 of a second.

tell application "Microsoft Excel"
	activate
	delay 0.1
	tell application "System Events" to tell process "Microsoft excel" to key code 14 using {control down, option down}
end tell

If you can identify the kind of runtime environment, you can deploy one code for multiple runtime.