extendscript

ExtendScript's UnitValue

会有一股神秘感。 提交于 2019-12-12 09:52:08
问题 So I can't find, for the life of me, a clear breakdown of the components of ExtendScript's UnitValue object. Every source I found had something to do with Adobe, and didn't explain it. I'd really like to have a full reference on it, but if no one can find one, I need at least a few questions answered concerning it. First, what are its constructors? I've seen UnitValue(10,'px') which makes sense, but I've also seen UnitValue(20,20) Second, how can you convert from one unit to another? Third,

What is the difference between app.doScript and $.evalFile?

风流意气都作罢 提交于 2019-12-12 07:59:20
问题 The only difference I have found so far: If a script that is run by app.doScript returns an error, the file and line number of the error are overridden by the file and line number of the app.doScript call. Are there any other differences I should know about? Here's sample code that demonstrates the above difference: First run InDesign: c: cd "C:\Program Files\Adobe\Adobe InDesign CS6 Server x64" InDesignServer.com -port 12345 pause Next create a batch file to run a script: c: cd "C:\Program

Adobe InDesign script change to uppercase and copy text to clipboard

旧巷老猫 提交于 2019-12-12 04:06:19
问题 I am try to create an Adobe InDesign script that will select text, change the selected text to Uppercase and then copy the same text. I am stuck. #target "InDesign" var myDoc = app.activeDocument; if(app.documents.length != 0){ if(app.selection.length == 1){ try{ //var text = app.selection[0]. var frame1 = page.textFrames[0]; //var frame2 = page.textFrames[1]; frame1.texts.everyItem().select(); //frame1. app.copy(); } catch(e){ alert ("Please select text", "Selection"); } } else{ alert (

Basil.js and ExtendScript in Indesign / How can I style textFrames?

早过忘川 提交于 2019-12-12 03:39:58
问题 After the svg elements are placed/drawn in Indesign, I wanna change the style from some or all elements . In my example I style the textFrames while they are drawn. My example works. But how can I change the style after the textFrames are placed? I wanna use the skewing angle (applied to the TextFrame) and the rotationAngle (look in my example -> forLoop) I tried the following: r.textFrames.shearAngle=20; and doc.textFrames.add({shearAngle:20}); ...but both don‘t work. #includepath "~

Extendscript Photoshop: Is there a way to save out jpeg with specific KB file sizes for web?

社会主义新天地 提交于 2019-12-11 19:26:19
问题 I'm trying to utilize the following. what this does is saves out Jpeg accordingly to less then a a certain size set. I was curious if anyone knew a way to specifically direct a filename to get a filesize that is equal to the following or as close as possible. Filename_160x600.png = Filename_160x600.jpg 39kb Filename_300x600.png = Filename_300x600.jpg 59kb Filename_1500x513.png = Filename_1500x513.jpg 150kb saveJPG( { path: activeDocument.path, maxSize: 50 //size in kbs }) function saveJPG(

How to select and delete every clipping masks in an Illustrator document using javascript?

浪子不回头ぞ 提交于 2019-12-11 12:36:08
问题 I'm making extend scripts for Adobe Illustrator CS6 (javascript) and I need to delete every clipping masks of a document. I already have a solution but it's not fast enough in big documents. Here is my code: var releaseClippingMasks = function(document) { var pathItems = document.pathItems; log('Looking for clipping masks among ' + pathItems.length + ' elements'); var n = 0; for(var p = pathItems.length - 1; p >= 0; p--) { if(p / 1000 == Math.round(p / 1000)) { log(p + ' remaining'); } if

Specifying Encoding While Placing Files In InDesign Using Extendscript

三世轮回 提交于 2019-12-11 12:28:05
问题 I have a script that places a Markdown file into a text frame in InDesign. Unfortunately, InDesign doesn't seem to be picking up on the UTF-8 encoding, as quotation marks and other things are ending up as ‚Äú . I tried setting file.encoding to "UTF-8" based on this question, all to no avail. Here's the relevant code as it stands: var file = File.openDialog ("Select content markdown" , "Markdown:*.md", false ); file.encoding = "UTF-8"; myFirstTextframe.place(file); How can I resolve this

getting XMP File does not have a constructor error through ExtendScript

不羁岁月 提交于 2019-12-11 09:05:08
问题 I am using In Design CC 2019, on my Mac OS. When I am trying to get XMP data for my .indd (InDesign document) using ExtendScript . I am currently getting the error like this: XMPFile Does not have a constructor . Below is my script. // load XMP Library function loadXMPLibrary(){ if ( ExternalObject.AdobeXMPScript){ try{ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');} catch (e){alert('Unable to load the AdobeXMPScript library!'); return false;} } return true; } var

InDesign CS5 Script: How can I close all modal dialog windows in a document?

会有一股神秘感。 提交于 2019-12-11 05:38:36
问题 When a document does not have any modal dialog window messages, app.activeDocument.close(SaveOptions.no) works fine. However, I have some InDesign documents that do have such windows appear, showing error messages about links that need to be updated, or incorrect styles. The above statement won't work in this case, as the windows prevent the script from accessing the document. So, is there a way to iterate through all of the modal-dialogs in the active document? Here is what I have tried so

Check InDesign Links for missing XMP - DocumentID and InstanceID

时间秒杀一切 提交于 2019-12-11 04:56:32
问题 I am using ExtendScript to work on metadata information of .indd files in InDesignCC 2019. My requirement is that I need to access all individual links metadata associated with the .indd file and see whether any of the links metadata is missing DocumentID and InstanceID . If any of the links metadata do not have a value for DocumentID and/or InstanceID properties then I need to display the file name associated with that link, indicating that, that particular file is missing a DocumentID and