I have a JSL script that has the following:
There is a function stored in a variable toJournal:
toJournal = Function({},
//some commands
);
I want to call this function inside a New Script message:
dt << New Script("save presentation",
toJournal();
journal << save presentation();
);
however due to name scope where I use names default to here(1) in my main script, the function toJournal isn't known when running the save presentation script button in the Data Table.
I would like to use Name Expr or some other command to have the function contents (in text) be inserted into the new script for evaluation when pressing the data table script button.
I've tried many options with no luck, for instance wrapping the function definition in Expr(), and using Expr, Name Expr...
dt << New Script( "Save Presentation All",
Eval Expr(Name Expr(toJournal));
jj << save presentation();
);
Any Help would be very much appreciated