Scripts Created via Script in SD6 and SD5 Fail to Make Window Dirty

Hey Mark,

This fails to make the newly created script document dirty in the latest SD6 and latest SD5.

set scriptSrc to "tell application \"Finder\"
   set selectedItems to selection as alias list
end tell
"
tell application id "com.latenightsw.ScriptDebugger6"
   make new document with properties {source text:scriptSrc}
end tell


Take Care,
Chris

1 Like

Chris,

What kind of error are you getting. When I run your script I get the following text in complied form:

tell application "Finder"
	set selectedItems to selection as alias list
end tell

If I type another character the window stays dirty. If I try to close the newly created window right after it was created I get the usual “Do you want to save the changes made to the document…” dialog. How do you know it’s not dirty?

Bill

Hey Bill,

I did mention that – the document window isn’t dirty.

You shouldn’t be getting a compiled script. The act of compiling will change the window status to dirty.

To compile you’d need to add a line to the script:

set scriptSrc to "tell application \"Finder\"
   set selectedItems to selection as alias list
end tell
"
tell application id "com.latenightsw.ScriptDebugger6"
   set newDoc to make new document with properties {source text:scriptSrc}
   compile newDoc
end tell

If it is in fact true that you’re getting a compiled script when you run my original AppleScript I’d like to know how – I’m not aware of any settings in Script Debugger that will auto-compile a script created like this.

When a Script Debugger document is dirty the close radio button in the upper left corner gets a dot in the middle.

Run the script.

Press W

The window will close without asking if you want to save it.

-Chris

Chris,

I created a movie of me running your script. I don’t know how, or if, I can upload a file to the Discourse group so I went back to the yahoo site and uploaded the movie there. The subject name of the Yahoo post is “Movie for Chris” It’s the only thing posted since July 9th. For some reason the red close circle for the newly created window does not have a dot in the movie but there was a dot there.

Perhaps you can see if I testing this incorrectly or doing something different then you. Originally I made the movie bigger but the file size was over 10meg so I had to make a movie of a smaller section of the screen and move the bottom of the newly created window up so you could see it said compiled.

I’m running El Capitan 10.11.5.

I hope this helps.

Bill

I can reproduce the problem and have a fix in hand for Script Debugger 6.0.1.

1 Like

Hey Mark,

Why would the script (in post #1) when run produce a new compiled script on other people’s systems but not mine?

-Chris

I’m not sure I can explain it. In my testing, I experienced the problem you found intermittently (not at first, and then consistently), but the failure in my code appears to be 100% repeatable.