用于在Windows上执行Indesign .jsx脚本的Sublime Text Build

时间:2014-05-29 00:27:03

标签: sublimetext3 adobe-indesign

我正在尝试编写一个崇高的文本构建来从Windows上的sublime文本执行一个indesign jsx脚本strait。对于Mac,由Basil https://github.com/basiljs/basil.js/tree/master/extras/Sublime%20Text构建,包含构建和osascript。

构建是:

      // copy this file to ~/Library/Application Support/Sublime Text 2/Packages/User
   {
       "cmd": ["osascript", "$packages/Basiljs/run_idscript_6.0.scpt", "$file"]
    }

osascript是:

 --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

我想用For Windows执行此操作,我已经完成了

  {
   "cmd": ["wscript", "$packages/creative-scripts/run_indesign.vbs", "$file"]
  }

我的wscript已经完成了

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

我收到以下错误消息 错误:需要对象:'idScriptLanguage' 代码:800A01A8

我现在根据弗拉德的回答编辑了改编的脚本,现在效果很好。

特雷弗

2 个答案:

答案 0 :(得分:3)

用它的实际值(1246973031)替换idScriptLanguage.idJavascript将解决问题。

答案 1 :(得分:1)

我已经提出了这个崇高构建的解决方案: - )

 {
    // for script to run must have #target "InDesign-7.0" "InDesign" Ietc. in it :-( otherwise the script will just open in the estk
    "cmd": ["C:\\Program Files (x86)\\Adobe\\Adobe ExtendScript Toolkit CC\\ExtendScript Toolkit.exe", "-run", "$file"]
 }

上面是64位系统,只需删除" (86)"对于一个32位的

请注意 #target

的必要性

它会提出一个标准的警告"你要跑吗......你想运行剧本吗?"

所以需要按y空格或输入。没有太大的交易,但要压制这个可以将脚本放入" Adob​​e Scripts"文档中的文件夹然后警告不会出现。

请参阅https://forums.adobe.com/message/4689581http://jfli04.blogspot.co.il/2011/08/how-to-run-js-in-estk-with-command-line.htm