Re: TextEdit AppleScript bug
Re: TextEdit AppleScript bug
- Subject: Re: TextEdit AppleScript bug
- From: John Delacour <email@hidden>
- Date: Tue, 15 Oct 2002 14:18:00 +0100
- Mac-eudora-version: 5.3 alpha
At 7:03 am -0400 15/10/02, Bill Cheeseman wrote:
James Hober reported to me that 'close front window saving yes' no longer
works correctly in TextEdit under Mac OS X 10.2 (Jaguar). It closes the
window, but it doesn't save changes to the file (whether the file has been
previously saved or not).
I get the same problem. Does this work for anybody?
If I use that syntax with an document that has unsaved changes, I get
a dialog whether I like it or not. The window does not close unless
I answer.
Instead I would use this, which does work:
tell app "TextEdit"
tell front document
save in path
close
end
end
'path' in TextEdit is the POSIX path and it's good to see that it
does not need to be converted to anything else in this case. Pity to
see that the syntax
tell app "TextEdit" to open "POSIX/pathname"
does not work. Instead, to be consistent, you'd have to write
set f to "'/tmp/temp.txt'"
do shell script "open -a 'TextEdit' " & f
JD
set f to "/tmp/temp.txt"
do shell script "perl -e '
$f = q~" & f & "~ ; open F, qq~>>$f~ ; `open $f`;'"
tell app "TextEdit"
tell front document
set its text to "hello"
save in its path
close
end
end
do shell script "open -a 'TextEdit' " & quoted form of f
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.