Thread View: adobe.scripting.indesign
6 messages
6 total messages
Started by mattnewell
Mon, 22 Dec 2008 19:38
Change text problem CS3
Author: mattnewell
Date: Mon, 22 Dec 2008 19:38
Date: Mon, 22 Dec 2008 19:38
5 lines
892 bytes
892 bytes
I am having problems with i2of5 barcode where some of the encoded values for the barcode are the same as InDesign values. e.g. find text "barcode" change text "�U(K\t�" inDesign recognizes the \t for a tab. Is it possible to turn off these keywords or variables so InDesign will not replace the string with a tab or whatever the variable stands for?
Re: Change text problem CS3
Author: Bob Stucky
Date: Mon, 22 Dec 2008 19:56
Date: Mon, 22 Dec 2008 19:56
5 lines
650 bytes
650 bytes
Try escaping the \ find text "barcode" change text "�U(K\\t�" Bob
Re: Change text problem CS3
Author: Robert Tkaczyk
Date: Mon, 22 Dec 2008 19:57
Date: Mon, 22 Dec 2008 19:57
8 lines
906 bytes
906 bytes
"\\t" instead of "\t" should work you need to double every "\" robin -- www.adobescripts.com
Re: Change text problem CS3
Author: mattnewell
Date: Mon, 22 Dec 2008 20:16
Date: Mon, 22 Dec 2008 20:16
3 lines
873 bytes
873 bytes
Unfortunately if you escape the \t or \r you get a single \ with a tab after. Also this is not the only case you also have ^p ^n and the list goes on and on. I would prefer turning this feature off and back on due to the fact I do use a lot of these features such as ^p and ^n for carriage returns.
Re: Change text problem CS3
Author: jongware
Date: Mon, 22 Dec 2008 20:50
Date: Mon, 22 Dec 2008 20:50
11 lines
1593 bytes
1593 bytes
Not true.
You are working in a script language. That translates "\t" to a tab while the script is being parsed, and (apparently) the tab survives the translation into the 'real' application call to search.
Next level is escaping the tab: "\\t". Now the codes get translated (by the parser) into "\t", which is, ta-da, a tab for the application search string.
So, you have to escape the escaped escape (?), leading to the somewhat bewildering "\\\\t". Double backslashes are translated into single ones ("\\t") which is passed over to the search inside InDesign, which translates it into "\t", which is what you asked.
The "^" is slightly easier, as it (probably!) is not 'pre-parsed' by your script, just by the InDesign Search engine. As in InDesign itself, to search for a single "^", enter two.
By the way ... there is no single search string in which both "\t" and "^p" are translated into a tab and paragraph return. The former is a GREP search expression, the latter a native InDesign Text search one.
Re: Change text problem CS3
Author: mattnewell
Date: Mon, 22 Dec 2008 21:13
Date: Mon, 22 Dec 2008 21:13
7 lines
1243 bytes
1243 bytes
Just to give some background I am using AppleScript and UT-8 XML so I can get the string to InDesign with out issues. So to test I was using the InDesign interface and doing a manual find and change. If you use a grep express and put \\t you will get a \ with a tab after. I will say it was confusing the way I explained the issue because I had two different things going on at once. The first problem I ran into was with ^p using change text so to fix this I went to change grep. By doing this I fixed one problem and created another. I see now I can use change text and double up on the ^ and the problem should be resolved. thanks for the help
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads