I'm trying to write a sublime text build to execute an indesign jsx script strait from sublime text on Windows. For the Mac there's a build by Basil https://github.com/basiljs/basil.js/tree/master/extras/Sublime%20Text that consists of a build and an osascript.
The build is:
// copy this file to ~/Library/Application Support/Sublime Text 2/Packages/User
{
"cmd": ["osascript", "$packages/Basiljs/run_idscript_6.0.scpt", "$file"]
}
The osascript is:
--usage:
--osascript run.scpt myscript.jsx
on run argv
set aScriptPath to "#include \"" & item 1 of argv & "\""
tell application "Adobe InDesign CS6"
do script aScriptPath language javascript
end tell
end run
I would like to do this with For Windows for my build I have done
{
"cmd": ["wscript", "$packages/creative-scripts/run_indesign.vbs", "$file"]
}
and for my wscript I have done
myScript = Wscript.Arguments.Item(0)
Set myInDesign = CreateObject("InDesign.Application")
MsgBox myScript ' just to check the path
Set myFileSystemObject = CreateObject("Scripting.FileSystemObject")
Set myFile = myFileSystemObject.GetFile(myScript)
myInDesign.DoScript myFile, 1246973031
I was getting the following error message Error: Object required: 'idScriptLanguage' Code: 800A01A8
I have now edited the script putting in the change as per Vlad's answer and it work very well now.
Trevor
Replacing the idScriptLanguage.idJavascript with it's actual value (1246973031) will solve the problem.