Copy link to clipboard
Copied
I want to call a program (*.exe ) from the UXP *.idjs script. Certain arguments need to be passed to *.exe. The result of the action is the creation of a PDF file that needs to be linked to the *.indd file. Is it possible to do this at this stage of development of idjs scripts in InDesign?
No, not possible.
Copy link to clipboard
Copied
No, not possible.
Copy link to clipboard
Copied
"The result of the action is the creation of a PDF file that needs to be linked to the *.indd file"
What do you need an exe app for in that case? Creating the pdf file is basically done in your idjs. And for attachments, you can embed the pdf.
Or is it the other way around to attach the indd file inside the PDF file?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Have you considered MathMagic? Looks to me that is the go-to plugin for tex files processing:
Copy link to clipboard
Copied
Along the same line as Loic's suggestion, have you looked at pandoc? It's my go-to command line tool for Weird Automated Text Format Conversion Stuff. Never tried to do anything TeX-related with it myself.
Copy link to clipboard
Copied
Thank you! Looks promising! I copied the manual and plan to play with it according to publishing needs. It will be interesting to see if this product can be used for multilingual publications.
Regarding solving the previously described problem, I decided to try to work with extensions (CEP). We only need to automate the already proven methods of publication layout.
Copy link to clipboard
Copied
MathType is another option.
I've recently created tool, macro for WORD, that converts equations exported on Mac from MathMagic to MathMl as a HTML into native WORD equations.
The problem wouldn't exist if there was MathType for Mac.
If you are on a PC - why not switch to VBA?
What exactly is your workflow / end result?
Copy link to clipboard
Copied
I only use it for multilingual publications 🙂
(We did a series of thirty-language manuals in print and html versions, where the tech writers stored their work on Github in Markdown, and we automated the process where every time they made changes to the Markdown, new .icml files would replace the old .icml files, and they would auto-update whenever you opened the .indd. Totally useless for you in your current project, of course, but it works quite well.)
Copy link to clipboard
Copied
Hi @vnh68 ,
even with ExtendScript I'm not sure if you could pass arguments to an app you are starting with file.execute().
Though, I'm not sure what you are exactly want to do in the moment you are using ExtendScript's method execute().
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Suppose we have a formula as text:
$\rm \sigma(\textit{X}_{\textit{i}}) = \sqrt{\displaystyle\sum\limits_{\textit{i}\, =\, 1}^{34}\,\left(\textit{X}_{\textit{i}} - \textit{M}(\textit{X}_{\textit{i}})\right)^2},$
And this is how part of the page looks after the script has completed its work:
The program creates a high-quality PDF of the formula, it just needs to call the program from the script and paste (using the script) the resulting PDF in the right place on the page.
When calling the program (*.exe), we need to pass the text of the formula as an argument.
The program itself determines all the sizes of characters, knowing only that the size of the surrounding text is 11 pt.
Also, instead of formulas, there can be TikZ graphics (function graphs, diagrams, etc.)...
Copy link to clipboard
Copied
Not sure where UXP is with doScript at the moment, but with ExtendScript that was pretty much the way to go to execute command line tools from Javascript. You can give it a try.
Copy link to clipboard
Copied
I've tried these methods with ExtendScript: the File class unfortunately cannot pass arguments to the called program, and the Application class's doScript method does not call any other types of programs than those described in ScriptLanguage, although it is possible to pass arguments.
I'll try to make a CEP extension. This is new to me, I don't know if there are restrictions for calling programs that operate on files in the operating system. The script for Node easily copes with the task, if called simply from Windows.
Copy link to clipboard
Copied
If you can't switch to VBA completely - at least you can create short VBA code and call it via doScript() from JS - then in this code you can call exe with arguments.
Copy link to clipboard
Copied
> Not sure where UXP is with doScript at the moment,
doScript() now works in UXP.
Copy link to clipboard
Copied
Hi Peter,
I still cannot see InDesign 18.4 as an update here in Germany.
So it could be that @vnh68 also has no access. Should be a matter of days perhaps, but I do not think, that doScript() for UXP is supported with InDesign 2023 version 18.3.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
> I do not think, that doScript() for UXP is supported with InDesign 2023 version 18.3.
Correct. But it does work in 18.4
Copy link to clipboard
Copied
Hi Peter,
I can get a simple app.doScript( myFunction() ) to work in UXP,
but not as I am used to in ExtendScript like this:
app.doScript('do shell script "' + doSomething + '"', ScriptLanguage.APPLESCRIPT_LANGUAGE);
Copy link to clipboard
Copied
Found it here:
InDesign UXP DOM
that ScriptLanguage.APPLESCRIPT_LANGUGE
is not supported, correct?
Copy link to clipboard
Copied
This code worked. The docs need to be fixed.
const { app, ScriptLanguage } = require('indesign') ;
app.doScript(`display dialog "Hello from AppleScript"`, ScriptLanguage.APPLESCRIPT_LANGUAGE) ;
Copy link to clipboard
Copied
Works for me now too. I forgot the require command. Thanks
Copy link to clipboard
Copied