Re: TextEdit oddity
Re: TextEdit oddity
- Subject: Re: TextEdit oddity
- From: "koenig.yvan" <email@hidden>
- Date: Tue, 20 May 2014 09:08:33 +0200
Le 20/05/2014 à 02:37, Shane Stanley < email@hidden> a écrit : On 20 May 2014, at 12:37 am, koenig.yvan < email@hidden> wrote: a bare version is :
tell application "TextEdit" to tell document 1 set leTexte to its text
set its text to (leTexte & "=azertyuiop=")
delay 0.1 set properties of its text to {font:"Menlo-Regular", size:11.0}
end tell
For most of the texts, all works well.
I just get a problem with large files. For instance, I have one text containing 141831 characters (including space ones) the script fails and the Events log display :
set properties of every text of document 1 to {font:"Menlo-Regular", size:11.0} --> error number -10000
After that I can't select something in the document's window and I am forced to quit TextEdit and reopen the document which happily is correctly saved.
Am’I doing something wrong or am’I facing a bug ?
It looks like you're facing a bug. It often gives me a TextEdit crash/continue dialog:
Exception Name: NSInternalInconsistencyException Description: -[NSLayoutManager _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] *** attempted glyph generation while textStorage is editing. It is not valid to cause the layoutManager to do glyph generation while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.) User Info: (null)
And I can see in Console entries like:
20/05/2014 10:13:22.696 am TextEdit[10164]: An exception was thrown during execution of an NSScriptCommand... 20/05/2014 10:13:22.696 am TextEdit[10164]: *** -[NSConcreteTextStorage attribute:atIndex:effectiveRange:]: Range or index out of bounds 20/05/2014 10:13:29.750 am TextEdit[10164]: -[NSLayoutManager _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] *** attempted glyph generation while textStorage is editing. It is not valid to cause the layoutManager to do glyph generation while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)
Given that it's happening when you're trying to replace the contents of the document, and given that TextEdit pretty much relies on built-in support for this sort of scripting, there may well be the same problem in other apps. So you should definitely report it.
Thanks Shane
Now I am even more puzzled.
Before asking here I looked in the Console and didn't got the relevant messages which you reproduce.
I just saw MANY messages like : 19/05/2014 22:07:46,000 kernel[0]: TextEdit[25398] Unable to quarantine: 93
and some others like : 19/05/2014 22:18:33,331 TextEdit[25398]: view service marshal for <NSRemoteView: 0x7fadb78834d0> failed to forget accessibility connection due to Error Domain=NSCocoaErrorDomain Code=4099 "Impossible de communiquer avec un utilitaire." (The connection was invalidated from this process.) UserInfo=0x7fadb3e713e0 {NSDebugDescription=The connection was invalidated from this process.} timestamp: 22:18:33.331 Monday 19 May 2014 process/thread/queue: TextEdit (25398) / 0x10cc9a000 / com.apple.NSXPCConnection.user.endpoint code: line 2972 of /SourceCache/ViewBridge/ViewBridge-46.2/NSRemoteView.m in __57-[NSRemoteView viewServiceMarshalProxy:withErrorHandler:]_block_invoke domain: communications-failure which doesn't seem to be related to what I face.
I will clean the crash reports and make a new attempt to be check if the crash and the message are related.
Yvan KOENIG (VALLAURIS, France) mardi 20 mai 2014 09:08:25
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden