Re: Help with find text command
Re: Help with find text command
- Subject: Re: Help with find text command
- From: Philip Aker <email@hidden>
- Date: Wed, 01 Aug 2007 22:20:15 -0700
On 2007-08-01, at 14:14:27, Wallace, William wrote: The overview of what I'm doing is:
Search through all the text flows in a bunch of InDesign layouts and wherever I find a 10 digit ISBN, look it up in a spreadsheet and find the current price, convert the 10 digit ISBN to a 13 digit ISBN and add both the new price and the 13 digit ISBN to the text flow immediately after the original ISBN.
It sounds like you're fairly wired into an AppleScript workflow already so maybe that's a consideration. Calling AppleScript from Tcl or any of the other shell languages is not a problem. IMO the only real consideration for you is speed. Without knowing the full particulars, I'd say that would primarily be governed by the number of times each layout has to be read/written plus whether or not you can pre-load the price/13-digit mapping table.
If I wanted to solve this in a Tcl native way, I'd probably keep the ISBN10/price/ISBN13 map in an SQLite database (it's wicked fast, native in Tcl, and included in recent Mac OS X versions). Then I'd use the 'regexp' to step through the text contents of each layout and upon a match, do the database lookup and new text insertion inline with 'regsub' (saving the new end offset for the next search start).
About extraneous matches, I generally try to avoid backslashes in regular _expression_ calls from AppleScript so here's another way to insert the word boundary delimiters:
"[[:<:]][[:digit:]X-]{13}[[:>:]]"
|
_______________________________________________
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