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

How to connect Indesign with Mysql database using javascript

New Here ,
Feb 08, 2022 Feb 08, 2022

I am trying to connect my Indesign with MySQL and retrieve data from there.  I am writing code in javascript. I found something like this should working 

 

app.doScript("do shell script \"C:\xampp\mysql\bin\mysql\ -u 'root' -p ' ' -d mysql -e 'select * table'\"", ScriptLanguage.APPLESCRIPT_LANGUAGE);
 
1.)  how I can check if I am really connected with my db.
2.)  how I retrieve data from there (how I can store them to some variable for fuure manipulation )?
 
TOPICS
How to , Import and export , Scripting , Sync and storage
580
Translate
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 ,
Feb 08, 2022 Feb 08, 2022
LATEST

Hi @Jasmin23057676xm60,

This approach might work but it will be really difficult to debug this. A more better approach would be to create a CEP extension where you can use full suite of modern JS tools and also node packages which will easily allow you to connect to the MySql DB. Then you can also connect your jsx file with the CEP extension to send query and get back the result.

-Manan

Translate
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