Copy link to clipboard
Copied
Dear all,
I'm writing the code using Extend Script (JSX) and planning to call the UXP script with Arguments, through doScirpt mode
//==================================================//
Could it be that the problem is that you are passing the idjs path as a string during doScript? If you pass File, it might succeed. I have had success with this script.
// caller.jsx
var argsArray = ['argString', 20, true] ;
var idjsFile = new File('~/Desktop/callee.idjs') ;
var res = app.doScript(idjsFile, ScriptLanguage.UXPSCRIPT, argsArray, UndoModes.ENTIRE_SCRIPT) ;
// callee.idjs
const { app } = require('indesign') ;
const { script } = require('uxp') ;
const alert = (msg) => {
cons
...
Copy link to clipboard
Copied
I know the 131522407 number is associated with "ScriptLanguage.UXPSCRIPT" in the UXPscript doScript, but I don't know if it would also work with extendscript. I would try to replace it with the actual text and see if that gets it for you.
Copy link to clipboard
Copied
Are you going to return data from the UXP script? if not, you should not have to make variable declaration for the doScript.
Copy link to clipboard
Copied
Dear John,
Thank you,
We tried the below options also, but Unable to get the argument values from JSX to UXP scripts.
Copy link to clipboard
Copied
Just use Label option - on the Document level.
Copy link to clipboard
Copied
Dear Robert,
Thank you for giving the solutions. We are also thinking the least options.
Means, we will update the data into the Document Label information (store in document frame or any conditional variables).
from UXP script will read it from the Document and run the UXP script.
Will plan to only execute the UXP script from JSX script.
We tried to do for ID-Tasker ... But no support for Mac OS.
Kindly let me know any other way to resolve the issue.... really will appriciate.
Thanks & Regards
Harihara Sudhan T R
Copy link to clipboard
Copied
Unfortunately, for Mac users, ID-Tasker is PC only.
Copy link to clipboard
Copied
Could it be that the problem is that you are passing the idjs path as a string during doScript? If you pass File, it might succeed. I have had success with this script.
// caller.jsx
var argsArray = ['argString', 20, true] ;
var idjsFile = new File('~/Desktop/callee.idjs') ;
var res = app.doScript(idjsFile, ScriptLanguage.UXPSCRIPT, argsArray, UndoModes.ENTIRE_SCRIPT) ;
// callee.idjs
const { app } = require('indesign') ;
const { script } = require('uxp') ;
const alert = (msg) => {
const dialog = app.dialogs.add() ;
const col = dialog.dialogColumns.add() ;
const colText = col.staticTexts.add() ;
colText.staticLabel = '' + msg ;
dialog.canCancel = false ;
dialog.show() ;
dialog.destroy() ;
return ;
} ;
alert(script.args[0]) ;
// --> 'argString'
Copy link to clipboard
Copied
Dear Sttk3,
Thank you, it is working fine, will call with Argument from JSX to IDJS script.
//=====================
let myInDesign = require("indesign");
let script = require("uxp").script;
let app = myInDesign.app;
let ufs = require("uxp").storage.localFileSystem;
const uxpfs = require("uxp").storage;
const shell = require("uxp").shell;
const osname = require("uxp").os;
const osInfo = require('os');
const UserHomeDirsInfo = osInfo.homedir();
let folder = await ufs.getEntryWithUrl("file:"+UserHomeDirsInfo+"/Desktop/StoryBoard_Workflow/Development/TempProcess");
try {
filePath = await folder.getEntry("connectURL.sh");
}
catch (error){
filePath = await folder.createEntry("connectURL.sh");
}
alert(script.args[0]) ;
//======================
But this is not working for the above code is in the IDJS script. because of the "await" function. It is mandatory to do my code of function.
So any other alrernate method is there, along with await functionalities in IDJS script. Mean, with arguments will work with "await" funcitons.
Thanks & Regards
Harihara Sudhan T R.,