--- In powerpro-beginners@yahoogroups.com, Brother Gabriel-Marie <brgabriel@...>
wrote:
>
> I am trying to figure this "RunScript" function: (watch for wordwrap)
[...]
>
> Function RunScript(whatscript);;<--THIS ONE!
> .@ComLoad()
> appRef.DoScript myJavaScript, idScriptLanguage.idJavascript, arguments[0])
> .@ComUnload()
> quit
> ----------------------------------
>
> .InDesign@RunScript(?"C:\Saint Cuthbert\Programming\Adobe
> Scripting\Adobe InDesign CS3\BGMscripts\testscript.jsx")
That should run it. If you put some messageboxes or debugs into the function you
should see them and be assured it is running.
This line is wrong:
> appRef.DoScript myJavaScript, idScriptLanguage.idJavascript, arguments[0])
Some of the problems:
1. no open parenthesis
2. you need the value not the name for idnames used in vbscripts and powerpro
3. There is no variable named arguments[0]
This works for me:
local idScriptLanguage=1246973031 ;;idJavascript
appRef.DoScript(myJavaScript, idScriptLanguage)
You could also use the value directly in the call, e.g.,
appRef.DoScript(myJavaScript, 1246973031)
Regards,
Sheri