extendscript

How to use Terminal command using ExtendScript toolkit

落花浮王杯 提交于 2020-01-17 04:55:07
问题 I need to use the terminal commands using Javascript on ExtendScript toolkit. For example, using pdffonts command on terminal window. pdffonts ~/Desktop/fontlist.pdf 回答1: If you use After Effects you can simply use: system.callSystem('Your command'); Or write your command into bat file, and then to use: new File('path/to/bat/file.bat').execute();//for windows new File('path/to/bat/file.sh').execute();//for mac 来源: https://stackoverflow.com/questions/33732071/how-to-use-terminal-command-using

Can I execute “Pathfinder > Crop” from the Pathfinder panel and NOT the “Effects > Pathfinder” menu?

自作多情 提交于 2020-01-05 07:54:12
问题 TLDR: I need to run Pathfinder > Crop on all art in a file that has a clipping mask applied but can’t seem to get Crop to fire correctly. UPDATE: After HOURS of chipping away at this I came to realize that the Crop option in the main menu (“Effect > Pathfinder > Crop”) does something entirely different than the Crop button in the Pathfinder panel. I’m using app.executeMenuCommand('Live Pathfinder Crop'); to crop the image, but this apparently fires the menu action. I need to access the crop

Is Windows 'clip' blocked in Adobe ExtendScript?

浪子不回头ぞ 提交于 2020-01-03 04:27:44
问题 In Adobe ExtendScript (based on java script) you can trigger system commands as if you are in a Windows console with 'system.callSystem()' This works: system.callSystem("notepad c:/test.txt") Notepad opens with the content of the file. But these examples that try to paste to the clipboard don't work:" system.callSystem('clip < c:/test.txt') system.callSystem('dir | clip') I've tried numerous variations with 'clip' and none of them work. Is 'clip' blocked from working with ExtendScript, or am

InDesign CS5 Script: Why is `#targetengine` not working correctly?

☆樱花仙子☆ 提交于 2019-12-25 05:06:02
问题 I understand that the declaration #targetengine "myEngineName" would be used for InDesign to remember global variables (found information on this here: http://incom.org/post/89818). However, this was still not enough for it to remember global variables as it still throws an error regarding the global variable imgs : Error Number: 30476 Error String: "if(imgs[i].itemLink != null)" could not be completed because the object no longer exists. ...or something like that anyway. It doesn't like that

How to set Excel Import Preferences in InDesign CS6 using extendscript?

怎甘沉沦 提交于 2019-12-25 03:38:33
问题 This seems like it should be really simple, but for some reason I can't get it to work at all. The following code has no effect whatsoever: function setExcelImportPrefs() { with(app.excelImportPreferences){ rangeName = "A1:Z300"; sheetName = "whatever"; tableFormatting = TableFormattingOptions.excelFormattedTable; } } And this doesn't work either: function setExcelImportPrefs() { with(app.excelImportPreferences){ app.excelImportPreferences.rangeName = "A1:Z300"; app.excelImportPreferences

Run illustrator extendscript through automator applescript or bash?

我只是一个虾纸丫 提交于 2019-12-24 12:05:58
问题 The following command will run the SCRIPT_ABC.jsx which is located on my desktop. Is there a way to take the contents of the SCRIPT_ABC.jsx and put the javascript extendscript exclusively inside automator so when I save it out as an application it will be included within the program? on run {input, parameters} tell application "Adobe Illustrator" to open file "Macintosh HD:Users:NAME:Desktop:SCRIPT_ABC.jsx" return input end run 回答1: Paste the entire jsx into your applescript as a text body,

What methods and properties are provided for use through scripting for standard InDesign panels?

假如想象 提交于 2019-12-24 09:28:18
问题 I’m able to get a reference to, for instance, the “Scripts” panel; but, although its constructor’s name is 'Panel' , it doesn’t seem to have the show and hide methods like panels created through scripting, or the window property, etc.: var scriptsPanel = app.panels.item('$ID/Scripts') scriptsPanel.window // → “Object does not support the property or method 'window'” scriptsPanel.show(); // → “scriptsPanel.show is not a function” It does have some of script-created Panels’ properties, though:

Javascript IIFE as an object's property (method)

偶尔善良 提交于 2019-12-24 01:55:55
问题 I'm trying to use an IIFE as a method (which might be wrong). Why ? Because, I'm trying to implement the proxy design pattern. In adobe extendscript, there is an "app" object to access documents, etc, like - var length = app.activeDocument.length; // or some other property Now, I wanted to put a proxy around "app". So I created a proxy object - var AppProxy = { activeDocument: function() { // do stuff...; return app.ActiveDocument; } } But now, this is how I had to access it - var length =

Adobe InDesign .jsx script execute .jsx script

岁酱吖の 提交于 2019-12-21 17:47:03
问题 How can I have my .jsx script when finished execute another .jsx script? Maybe this will help understand what I am trying to do: // WebCard.jsx file function mySnippet(){ //<fragment> var myPageName, myFilePath, myFile; var myDocument = app.documents.item(0); var myBaseName = myDocument.name; for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){ myPageName = myDocument.pages.item(myCounter).name; app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange

How to detect shift down when clicking on ScriptUI button?

两盒软妹~` 提交于 2019-12-21 05:33:48
问题 On my scriptUI panel, I have a button. How can I detect whether the user is holding the shift key when they click on the button? 回答1: You can add an eventListener to your button. var win = new Window ("dialog"); win.aButton = win.add ("button", undefined, "Button"); win.aButton.addEventListener ("click", function (k) { if (k.shiftKey) { alert("foo"); }else{ alert("bah"); } }); win.show (); 来源: https://stackoverflow.com/questions/16446076/how-to-detect-shift-down-when-clicking-on-scriptui