Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(VB CS3) How do I reference a saved Grep query?

15 views
Skip to first unread message

Jean-Pau...@adobeforums.com

unread,
Apr 1, 2009, 3:01:51 PM4/1/09
to
I want to run multiple saved Grep queries on an open document in a particular order using a VB script but can't figure out how to reference them. If this is not possible, pointing me towards a reference on telling ID Grep what to do with VB would be helpful too. Thanks!

Robert Tkaczyk

unread,
Apr 1, 2009, 5:19:51 PM4/1/09
to
Sub LoadFindChangeQuery(QueryName As String, SearchMode As idSearchModes)
Member of InDesign.Application
Loads the specified find/change query. / QueryName: The query to load. / SearchMode: The search mode.

but you need to know the name - somebody didn't think about giving us list with saved queries ...

so you have two options:
a) you know Queries names
b) you will look for XML files in four subdirectories (text, grep, glyph, object) located in:
%USERPROFILE%\AppData\Roaming\Adobe\InDesign\Version 5.0\Find-Change Queries\ subfolder - XML file name is Query's name - and I think CaseSensitive ...

next "problem" - there could be localized name of "Version 5.0" subfolder - i.e. "Wersja 5.0" ... so if you have InDesign's user interface set to your language - I think you should change "Version 5.0" subfolder name ... I'm using EN interface so my queries are saved in "Version 5.0" subfolder

in CS4 finally somebody thinks better - all localized versions of InDesign have universal names of subfolders - en_GB, es_ES, ja_JP, en_US, hu_HU, pl_PL - and in these subfolders you can find "Find-Change Queries" subfolder and inside - text, grep, glyph, object subfolders

%USERPROFILE%\AppData\Roaming\Adobe\InDesign\Version 6.0\en_GB\Find-Change Queries\

but CS4 still doesn't have list of saved queries ...

robin

--
www.adobescripts.com

Robert Tkaczyk

unread,
Apr 2, 2009, 8:55:31 AM4/2/09
to
update - saved Find-Change Queries are visible in InDesign ONLY in the same user interface language ...

robin

--
www.adobescripts.com

Jean-Pau...@adobeforums.com

unread,
Apr 2, 2009, 11:36:43 AM4/2/09
to
I really appreciate the rapid and detailed response Robert!
I think that indicating a path to the XML version of the query might be a little too complex for me right now, considering that I can't get a straightforward Grep to work in VB while more work keeps flooding in.
Can someone show me a simple example that incorporates the following (assuming that is is correct)?

myInDesign.FindGrepPreferences.FindWhat = "(?i)foo"
myInDesign.ChangeGrepPreferences.ChangeTo = "$0-bar"

I can get this to work --
myInDesign.FindTextPreferences.FindWhat = "Foo"
myInDesign.ChangeTextPreferences.ChangeTo = "Bar"

But that doesn't help me with issues of spacing or mixed case that I'm dealing with.

Thank you so much for any input.

Jean-Pau...@adobeforums.com

unread,
Apr 2, 2009, 11:36:36 AM4/2/09
to
0 new messages