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
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?
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.
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 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.