• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get FindChange query data

Explorer ,
Aug 12, 2018 Aug 12, 2018

Copy link to clipboard

Copied

Hi Experts,

Screen Shot 2018-08-13 at 1.03.11 AM.png

I want to get all the saved queries in Find/Change.
Query names and their query data, i.e replace text, find text...etc
Only thing I could find was IFindChangeOptions but it does not have classes related to queries.

Can you please help me.

TOPICS
SDK

Views

800

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 12, 2018 Aug 12, 2018

Hello ddarz4u​,

I also could not find any way in the C++ sdk to get this list. It seems this is not meant to be accessible by a direct api call. However i have a way to achieve what you need, the custom queries are saved as XML files, you can parse these files and then load a particular query(could not find a C++ sdk to do the same directly). So you could traverse the folder location where the custom queries are saved, use it to get the list of all the queries(file name is displayed in the File C

...

Votes

Translate

Translate
Community Expert ,
Aug 12, 2018 Aug 12, 2018

Copy link to clipboard

Copied

Hello ddarz4u​,

I also could not find any way in the C++ sdk to get this list. It seems this is not meant to be accessible by a direct api call. However i have a way to achieve what you need, the custom queries are saved as XML files, you can parse these files and then load a particular query(could not find a C++ sdk to do the same directly). So you could traverse the folder location where the custom queries are saved, use it to get the list of all the queries(file name is displayed in the File Change dialog). The you can parse the XML file to set the appropriate interfaces to make the find change query, and execute it. Let me know if you find a direct API to load query as present in the JS api, alternatively you could call the JS code from C++ plugin.

Look at the load queries section in the following URL to get the locations at which the custom queries are saved

https://helpx.adobe.com/in/indesign/using/find-change.html#find_change_items_using_queries

Hope this helps.

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 13, 2018 Aug 13, 2018

Copy link to clipboard

Copied

Manan is right, there's no straight api to load the query names, it's a manual work. But once you get the IDFile queryXMLFile, load query with command

kFCQueryXMLReaderCmdBoss

InterfacePtr<ICommand>queryCmd(CmdUtils::CreateCommand(kFCQueryXMLReaderCmdBoss));

InterfacePtr<ISysFileData> sysFile(queryCmd, UseDefaultIID());

sysFile->Set(queryXMLFile);

CmdUtils::ProcessCommand(queryCmd);

Then you can use IFindChangeOptions to get the options data, example:

InterfacePtr<IFindChangeOptions>pFindChangeOptions((IFindChangeOptions*)::QuerySessionPreferences(IID_IFINDCHANGEOPTIONS));

WideString findString = pFindChangeOptions->GetFindString(IFindChangeOptions::kTextSearch);

WideString replaceString = pFindChangeOptions->GetReplaceString(IFindChangeOptions::kTextSearch);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 13, 2018 Aug 13, 2018

Copy link to clipboard

Copied

Thanks for the insight Alo, i missed the command (the chm search has its own idiosyncrasies )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 14, 2018 Aug 14, 2018

Copy link to clipboard

Copied

Hello,

From jsx, app.loadFindChangeQuery.

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2018 Aug 14, 2018

Copy link to clipboard

Copied

Thanks Pickory​​

To get this, we should have to have query names list?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 14, 2018 Aug 14, 2018

Copy link to clipboard

Copied

LATEST

Hello,

For the docs.

void  loadFindChangeQuery (queryName: string, searchMode: SearchModes)

Value

NameDescriptionValue
SearchModes.GLYPH_SEARCHGlyph search.1181183091 = 'Fgls'
SearchModes.GREP_SEARCHGrep search.1181184627 = 'Fgrs'
SearchModes.OBJECT_SEARCHObject search.1181704819 = 'Fobs'
SearchModes.TEXT_SEARCHText search.1182038131 = 'Ftxs'

Usage

In function

void  Application.deleteFindChangeQuery (queryName: string, searchMode: SearchModes)

void  Application.loadFindChangeQuery (queryName: string, searchMode: SearchModes)

void  Application.saveFindChangeQuery (queryName: string, searchMode: SearchModes)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines