Skip to main content
Robert at ID-Tasker
Legend
September 14, 2023
Answered

How to get "Locale" subfoler for Text / Grep search queries?

  • September 14, 2023
  • 3 replies
  • 341 views

This is an example of the full path to the saved XML files with Text Search Queries - for GREP / Color / Glyph / Object it's the same:

 

C:\Users\[user_name]\AppData\Roaming\Adobe\InDesign\Version 18.0\en_GB\Find-Change Queries\Text\

 

The 18.0 part is easy - can be extracted from Application.Version - but en_GB isn't...

 

There is an Application.Locale:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Locale.html

but it's just a number.

 

My current value is:

Locale.INTERNATIONAL_ENGLISH_LOCALE

International English.

1279477097

 

But from this:

https://www.localeplanet.com/icu/

 

there can be a lot of combinations...

 

Anyone knows how to get CURRENT / ACTIVE en_GB?

 

This topic has been closed for replies.
Correct answer Peter Kahrel

The Grep queries are here:
app.scriptPreferences.scriptsFolder.parent.parent + '/Find-Change Queries/Grep/'

The other queries spak for themselves.

3 replies

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
September 14, 2023

The Grep queries are here:
app.scriptPreferences.scriptsFolder.parent.parent + '/Find-Change Queries/Grep/'

The other queries spak for themselves.

Community Expert
September 14, 2023

Hi @Robert at ID-Tasker ,

try this one:

alert( app.scriptPreferences.scriptsFolder.parent.parent.name );

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Robert at ID-Tasker
Legend
September 14, 2023

Or the only way would be to use Application.SaveFindChangeQuery:

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Application.html#d1e42253__d1e48324

 

with some temporary / unique name and do a search in all subfoders, starting from:

 

C:\Users\[user_name]\AppData\Roaming\Adobe\InDesign\

 

to also get correct Version folder?

 

Robert at ID-Tasker
Legend
September 14, 2023

Thanks @Peter Kahrel and @Laubender - that's very helpful.