Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Script for Find/Change
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Lorand" data-source="post: 223330" data-attributes="member: 14405"><p>Hi everyone,</p><p></p><p>I'm working on QuarkXpress Passport 6.5 and frequently get DOS-coded</p><p>texts, so I need a script to replace some characters without altering</p><p>the style of them.</p><p>Here's my first try (yes, I'm a noob in scripting...):</p><p></p><p>[CODE]tell document 1 of application "QuarkXPress Passport"</p><p> activate</p><p> tell current box</p><p> tell story 1</p><p> repeat with i from 1 to count characters</p><p> tell character i</p><p> if it is "º" then</p><p> set contents to "§"</p><p> else if it is "ã" then</p><p> set contents to "["</p><p> else if it is "˛" then</p><p> set contents to "\\"</p><p> else if it is "ª" then</p><p> set contents to "±"</p><p> else if it is "˚" then</p><p> set contents to "|"</p><p> else if it is "Ã" then</p><p> set contents to "{"</p><p> end if</p><p> end tell</p><p> end repeat</p><p> end tell</p><p> end tell</p><p>end tell[/CODE] </p><p>And surprizingly it works. But it's very-very-very slow...</p><p>Is there a way to make a (much more) faster script for this job?</p></blockquote><p></p>
[QUOTE="Lorand, post: 223330, member: 14405"] Hi everyone, I'm working on QuarkXpress Passport 6.5 and frequently get DOS-coded texts, so I need a script to replace some characters without altering the style of them. Here's my first try (yes, I'm a noob in scripting...): [CODE]tell document 1 of application "QuarkXPress Passport" activate tell current box tell story 1 repeat with i from 1 to count characters tell character i if it is "º" then set contents to "§" else if it is "ã" then set contents to "[" else if it is "˛" then set contents to "\\" else if it is "ª" then set contents to "±" else if it is "˚" then set contents to "|" else if it is "Ã" then set contents to "{" end if end tell end repeat end tell end tell end tell[/CODE] And surprizingly it works. But it's very-very-very slow... Is there a way to make a (much more) faster script for this job? [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Script for Find/Change
Top