![]() ![]() That said, for people who spend a lot of their time in a favorite text editor doing many things other than working in Stata, it can be invaluable to be able to do your Stata work in the same environment. Certainly, if this does everything you need, there's no reason not to use it. If a particular character doesn't exist in the document I get this error:Įrror "QuarkXPress got an error: Cant set every text of every story of document 1 whose it = \"\" to \"\".Since Stata 11 especially, and even since then, it's gotten better and better, obviating the need for integration into third-party text editors.It has gotten better, and this is a fantastic thing, because for many users, I can now recommend that they simply use the built-in editor (together with the Project Manager) which saves them a lot of hassles. I need to run this on old files that may or may not have the characters. I have determined that the replacement font doesn't matter as long as it is not "Diacritical-Regular". The script has to set the search font to "Diacritical-Regular". Set (every text of every story where it is "") to "" Set (every text of every story where it is "`") to "" ![]() (The list will get longer as we identify all the problem characters.) Here is a script that runs without error but doesn't yet offer the solution needed. Firefox works, I keep it solely for posting on here!Īttempting to simplify and clarify and using Firefox as recommended: PS If you can use a different browser, you will get line returns and your posts will be much easier to read! Annoying, I know. Then, try and get it to identify the characters you want to change.Ĭome back when you've got a bit further, if there are more issues. First, get a script that will identify your text ranges (the suggestions I've made above should get you that far). Your best approach is to start a new script and build it a bit at a time, testing as you go along. You've already established that the font in theRanges is Diacritical, so this is meaningless. Next problem: in the 'set contents' line, you can't have a 'where the font is'. If you take out the 'and contents is.' you will find that this line works. Next problem: I don't think text style ranges include content - they are about style. However, even 'document' doesn't understand 'text style ranges'. Tell document 1 of application "QuarkXPress" You need first and foremost to address your script to the Document, so change your first line to: The application properties are general things such as layout preferences, language. ![]() Your script currently addresses the Application Quark (tell application "QuarkXPress"). Mine is sketchy, so if I make mistakes, I hope someone will correct me! You need to get some understanding of the hierarchy of objects in Quark. ![]() tell application "QuarkXPress"activateset theRanges to (object reference of every text style range where the font is "Diacritical-Regular" and contents is "")set rangeCount to count of items of theRangesrepeat with thisItem from 1 to rangeCountset contents of item thisItem of theRanges to ("u " where the font is "Times New Roman")end repeatend tellThis is error message:error "QuarkXPress got an error: Cant get object reference of every text style range whose font = \"Diacritical-Regular\" and contents = \"\"." number -1728 from object reference of every text style range whose font = "Diacritical-Regular" and contents = "" So I need to change the diacritics while in Quark to something that plays nice downstream and can be scripted in TextWrangler to unicode (which is easy!).Two examples in unicode: and Here is my hobbled together attempted script for the. There are many diacritics that once out of Quark are not readable because they are in a Diacritical font that doesn't export (in fact even the clipboard "sees" the letters as something different than is displayed in Quark). I need to export content out of Quark on an ongoing basis. My Applescript-Quark skills are barely beyond the basics. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |