A/S Editor bug?

Run this in a new Editor window:

tell application "AppleScript Editor"-- v. 2.3
	path of document 1
	--> no result
end tell

That explained why the applet I was playing with would hang (not freeze, just stop doing anything at all).
This old trick (iCal?) revived it:

tell application "AppleScript Editor"
	set props to properties of document 1
	path of props
	--> missing value
end tell

Is this ‘common knowledge’?


I have no idea whether that knowledge is common, I usually check for the name of the document, but it beats me that this is a much better way of finding out that a document is unsaved, with regards to locallization. :slight_smile:

tell application "AppleScript Editor"
	set a to name of its front document
end tell
log a
--> 5 uten navn

tell application "Finder" to set nameDefault to localized string "NS3" -- localised version of "Untitled"

That applet’s save handler deals with documents that have been saved before. It has three other handlers that also save documents, so there’s a lot of duplicate code, which I’m trying to sort out. And no error handling whatsoever, so a lot of time goes into watching what it does - or doesn’t do.

[The onscreen logging device I wrote/stole makes me really happy, now :D]


The localized string looks nice. When it comes to the Script Editors, I usually script all three of them at once, and then use the error message in a display dialog. I think the fact that a path contains a missing value is a much nicer way to handle this. Contemplating this, I think I have used the missing value state for figuring it out in other apps, this is fairly general behaviour I believe.