extendscript

Passing the result of a python script to an ExtendScript `.jsx` file

孤街醉人 提交于 2019-12-10 23:04:12
问题 So, I'm writing a python script that gets data from a google sheet and returns it back to an ExtendScript script that I'm writing for After Effects. The relevant bits are : getSpreadsheetData.py def main(): values = getSpreadsheetRange("1M337m3YHCdCDcVyS4fITvAGJsw7rGQ2XGbZaKIdkJPc", "A1:Q41") return processValues(values) afterEffectsScript.jsx var script_file = File("getSpreadsheetData.py"); var results = script_file.execute(); $.writeln(results); alert("done!"); So, I have three questions :

Manipulating text in a TextBox in Adobe InDesign CS5

青春壹個敷衍的年華 提交于 2019-12-10 12:58:06
问题 How can I do some manipulations with the text in a TextBox on resize in Adobe InDesign CS5 ? The main goal is too split the last word on every row to achieve something like a custom hyphenation. Is it possible using JavaScript (or ExtendScript ?) ? Thanks. UPDATE I've tried to describe my problem in comments I need an example on ExtendScript , which would find textbox dimensions and hyphenate the text according to dimension and after I'd like to create an event on textbox resize, which would

Open web page in After Effects with ExtendScript

大城市里の小女人 提交于 2019-12-09 07:16:29
问题 This may be a simple one but I can't figure it out. How can I open a web page in the main browser from extendscript as I would do with window.open() in Javascript? I am targeting After Effects and would like it to work on both OS X and Windows. 回答1: In After Effects you can simply do it using the system object, as Dirk mentioned. However you need several things for that: checking that the script can access the network: if (app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING

need setProperty syntax for XMP object

此生再无相见时 提交于 2019-12-08 22:38:52
问题 I am randomly generating DocumentID and InstanceID , but facing problem in setting property DocumentID and InstanceID to the xmp object. How can I set the generated DocumentID and InstanceID to my allXMP ? var xmpFile = new XMPFile(linkFilepath, XMPConst.FILE_INDESIGN, XMPConst.OPEN_FOR_UPDATE); var allXMP = xmpFile.getXMP(); // Retrieve values from external links XMP. var documentID = allXMP.getProperty(XMPConst.NS_XMP_MM, 'DocumentID', XMPConst.STRING); var instanceID = allXMP.getProperty

Automate Batch Script - Convert filenames to text in Photoshop

前提是你 提交于 2019-12-08 12:25:03
问题 How do you convert each filename of a bunch of files, each to a text layer (and save) in Photoshop? Folder 1: Hundereds of files Folder 2: Nearly the same files, but each with its filename plastered onto its image Here is a hacked up snippet. The error that I can't seem to get by is how to set the activeDocument to the currently open one. http://pastebin.com/b0fqG9v4 回答1: Hasn't been marked as answered so here's a javascript example for CS (and should work on later versions too) in case

How to script InDesign/InCopy to “Check In” and “Check Out” textFrames?

拈花ヽ惹草 提交于 2019-12-08 07:39:17
问题 I am not very familiar with InCopy. I keep seeing that it's a separate application, but I only have InDesign CS6 here, no InCopy CS6. Yet I am able to access InCopy functions within InDesign, such as "checking out/in" various textFrames for editing, then refreshing them in the Links panel so they update other textFrames on other pages in the document. My question is this—How can I use ExtendScript to automate this process?: InCopy > Check Out a specific textFrame. Alter the text within it, or

Function to show/hide layer with Photoshop script (JSX)

给你一囗甜甜゛ 提交于 2019-12-07 11:13:49
问题 I am writing a script that will loop through layers, trim them and export. So far I have most of all the element I need to complete this script. The only thing I can't find is how to show/hide an individual layer. I've found functions to show/hide all layers but nothing for one single layer. /////////////////////////////////////////////////////////////////////////////// // selectAllLayers - select all layers (Select > All Layers) ///////////////////////////////////////////////////////////////

How to script InDesign/InCopy to “Check In” and “Check Out” textFrames?

六眼飞鱼酱① 提交于 2019-12-07 02:52:31
I am not very familiar with InCopy. I keep seeing that it's a separate application, but I only have InDesign CS6 here, no InCopy CS6. Yet I am able to access InCopy functions within InDesign, such as "checking out/in" various textFrames for editing, then refreshing them in the Links panel so they update other textFrames on other pages in the document. My question is this—How can I use ExtendScript to automate this process?: InCopy > Check Out a specific textFrame. Alter the text within it, or its properties, etc. InCopy > Check In that textFrame. Refresh the links so that the other InCopy

How can I programmatically clear text selection in InDesign with ExtendScript?

谁都会走 提交于 2019-12-06 08:17:22
问题 I've programmatically selected some text in InDesign using ExtendScript: app.findGrepPreferences = NothingEnum.nothing; app.findGrepPreferences.appliedFont = myFont; var matches = app.activeDocument.findGrep(); if(matches.length > 0) { matches[0].select(); } How can I deselect it now? Is there no function for this, like app.clearSelections(); or something of the sort? 回答1: Try with: app.activeDocument.select(NothingEnum.NOTHING); 来源: https://stackoverflow.com/questions/10743073/how-can-i

Can Adobe .jsx scripts include other script files?

喜欢而已 提交于 2019-12-06 06:10:03
问题 We're writing a bunch of .jsx scripts and in each I have to mock out some functions so I can use things like Array.map() and String.trim(), but I don't want to have to include that code at the top of every script. Is there a way to "include" other .jsx scripts inside of a .jsx script file? 回答1: Or you can simply use #include and #includepath preprocessor directives at the top of your script. You can find a detailed description in Adobe's "JavaScript Tools Guide". For example, if you want to