rui huang
Participant
rui huang
Participant
Activity
Dec 26, 2024
11:35 PM
Hi Souvik, when I reset security, add folder path to trust , now I can process preflight via vbscript. Set pdDoc = avDoc.GetPDDoc Set jsObj = pdDoc.GetJSObject Dim jsCode jsCode = "var oProfile = Preflight.getProfileByName('Convert fonts to outlines'); var myPreflightResult = this.preflight( oProfile);" AForm.Fields.ExecuteThisJavaScript jsCode
... View more
Dec 21, 2024
01:11 AM
Hi Souvik, Thanks for your reply, In fact, Preflight can be run via javascript on mac, pls see: https://community.adobe.com/t5/acrobat-discussions/script-to-pdf-convert-all-text-to-outline/m-p/14742946 but I just want to try to implement this function by VBscript on a windows pc
... View more
Dec 20, 2024
01:46 AM
Hello, everyone, What code should be added to achieve this function? Dim gApp, avDoc Set gApp = CreateObject("AcroExch.app") Set avDoc = CreateObject("AcroExch.AVDoc") Dim filepath filepath = "C:\\test.pdf" If avDoc.Open(filepath, "") = True Then avDoc.BringToFront ' add vbscript code in here avDoc.Close True Else Msgbox "Failed to open PDF" End If Set pDDoc = Nothing Set avDoc = Nothing Set gApp = Nothing
... View more
Dec 20, 2024
12:28 AM
I wrote a script, and I want it to be executed whenever a PDF file is closed. how to do ?
... View more
Dec 03, 2024
09:54 PM
Hello, everyone, I use the following method to loop the list of objects var glen = app.activeDocumen.layers[0].groupItems; for (var i = glen.length - 1; i >= 0; i--) { } but I want to loop the objects from left to right on artboard, instead of base on layer, Is it achievable? thanks
... View more
Aug 08, 2024
08:13 PM
1 Upvote
@Charu Rajput , Thanks for sharing how to change fill and stroke color by directly replacing the color, solved my problem. https://community.adobe.com/t5/illustrator-discussions/change-color-swatch-to-other-color-swatch/m-p/13487155
... View more
Aug 08, 2024
12:32 AM
Hello , everyone. I want to change the color of the text to CMYK with convert swatch color, but it fails. when I manually convert it and GLOBAL option is checked, that's successful. but below script did not make GLOBAL option checked. Is it possible? var newColor = new CMYKColor(); newColor.black = 100; newColor.cyan = 0; newColor.magenta = 0; newColor.yellow = 0; var ignoreColors = ['[None]', '[Registration]']; var doc = activeDocument; var swatches = doc.swatches; for (var i = 0; i < swatches.length; i++) { var shouldIgnore = false; for (var j = 0; j < ignoreColors.length; j++) { if (swatches[i].name === ignoreColors[j]) { shouldIgnore = true; break; } } if (!shouldIgnore) { alert(swatches[i].name); swatches[i].color = newColor; } }
... View more
Aug 07, 2024
10:27 PM
I want to convert all the colors of the PDF to CMYK(C=0, M=0, Y=0,K=100). Is it possible?
... View more
Jul 17, 2024
12:54 AM
I got a tip from somewhere else, the following should be OK, I hope it is useful to everyone set myFolder to (((path to desktop) as text) & "thScript:temp:") tell application "Finder" set pdfFileName to "test.pdf" set filePath to myFolder & pdfFileName tell application "Adobe Acrobat" activate open file filePath tell document 1 do script "var oProfile = Preflight.getProfileByName('Convert fonts to outlines'); this.preflight(oProfile);" end tell save document pdfFileName to file filePath close document 1 saving no end tell end tell
... View more
Jul 15, 2024
11:03 PM
Hello, below function don't get the color name if parameter is compound path Item, how can this be achieved? function getColor(compoundItem) { var colorName; if (compoundItem.strokeColor instanceof SpotColor) { var stColorName = compoundItem.stroke.spot.name; if(stColorName === "Diecut"){ colorName= "Diecut"; } } return colorName; }
... View more
Jul 15, 2024
05:40 PM
hello, do you know how to convert all text to outline in Adobe Acrobat with applescript, thanks
... View more
Jul 03, 2024
07:47 PM
TRY67, thanks a lot, I can use AppleScript to automate the conversion to EPS. Here is a simple example. set myFolder to (((path to desktop) as text) & "thScript:temp:") tell application "Finder" set pdfFileName to "123_TH.pdf" set filePath to myFolder & pdfFileName tell application "Adobe Acrobat" activate open file filePath set AppleScript's text item delimiters to {"_", ".", " "} set prefix to first text item of pdfFileName set AppleScript's text item delimiters to "" set epsName to myFolder & prefix & ".eps" save document pdfFileName to file epsName using EPS Conversion with embedded fonts, images, preview, separations and annotation without binary given postScript level:3 close document 1 saving no end tell end tell
... View more
Jul 02, 2024
02:13 AM
I can use java to open a pdf file with acrobat. now the difficulty of the problem is how to execute the eps code after opening it, and the next file can still continue to execute eps code. where to set up automatic execution code ?
... View more
Jul 02, 2024
01:36 AM
My purpose is to batch process save as eps, rather than write a script for each PDF.
... View more
Jul 02, 2024
01:22 AM
I see a code: var otherDoc = app.openDoc("/c/myDoc.pdf") to open a pdf, but this code how to execute by acrobat ?
... View more
Jul 02, 2024
12:04 AM
script Acrobat is difficult for me,because it don't like Illustrator , can use "#target illustrator" to executing code. I don't know how to write a javascript to open pdf with Acrobat , then save as eps.
... View more
Jul 01, 2024
12:03 AM
I setup a Action Wizard action in Adobe Acrobat Pro, the purpose is to save the PDF as eps. I hope open a pdf file , then automatically perform actions, how to do with script?
... View more
May 26, 2024
06:47 PM
2 Upvotes
code should use "do javascript of file scriptPath with arguments argumentsList"
... View more
May 24, 2024
10:49 PM
1 Upvote
I can use similar logic to passing value with illustrator, but PS occur an error. why ? There is no problem with the file path. Is it related to security permissions? also, Software Menu---File----scripts----browse, then I can't select .scpt format file, it is strange. result: error "Adobe Photoshop 2024 got an error: Can’t get file \"Macintosh HD:Users:c144:Desktop:thScript:CovertBMP.jsx\"." number -1728 from file "Macintosh HD:Users:c144:Desktop:thScript:CovertBMP.jsx" applescript: set userName to short user name of (system info) set baseFolderPath to "/Users/" & userName & "/Desktop/thScript/" set scriptFileName to "CovertBMP.jsx" set scriptPath to baseFolderPath & scriptFileName as POSIX file set nameParameter to {"1887-9-01.eps", "1887-9-(1).bmp", "600", "/Users/c144/Desktop/thScript/"} set argumentsList to {nameParameter} tell application "Adobe Photoshop 2024" activate do javascript scriptPath with arguments argumentsList end tell javascript: #target Photoshop var arr = []; function main(dataIn) { var value1 = dataIn[0]; var value2 = dataIn[1]; var value3 = dataIn[2]; var value4 = dataIn[3]; arr.push(value1); arr.push(value2); arr.push(value3); arr.push(value4); } main(arguments[0]); var epsName = arr[0] ; var bmpName = arr[1]; var pixels = arr[2]; var folderPath = arr[3];
... View more
May 24, 2024
12:37 AM
sorry, actually you are right, there is no problem with the code, just set the security permissions with illustrator.
... View more
May 22, 2024
07:49 PM
now I know how to solve the problem. should be "do javascript file", it is missing word "file"
... View more
May 22, 2024
02:48 AM
Thank you very much for your detailed and patient answer. I may need to change the system language to English and try again.
... View more
May 22, 2024
02:10 AM
still be same error , do I need to install software to parse javascript code ?
... View more
May 22, 2024
02:00 AM
hello, it is my first time to write apple script. I get the error: javascript code was missing. could you tell me where is wrong ? thanks test.scpt property scriptPath : "Macintosh HD/用户/china144/桌面/TEST/test.jsx" as POSIX file tell application id "com.adobe.Illustrator" activate do javascript scriptPath with arguments {"foo", "bar"} end tell test.jsx testFunc(arguments); function testFunc(t) { alert('argument one: ' + t[0] + '\r' + 'argument two: ' + t[1]); }
... View more
May 21, 2024
04:18 PM
You've been a great help. Thank you for sharing your knowledge and solving my problem.
... View more
May 20, 2024
10:37 PM
1 Upvote
Hello, could help me to convert below extend script to apple script, thanks. Convert path of PDF to artboard. #target illustrator app.preferences.setBooleanPreference("ShowExternalJSXWarning", false); var lines = {"x", "y", "g"}; var oldPdfName = lines [0]; var newPdfName = lines [1]; var folderPath = lines [2]; app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; var pdfOptions = app.preferences.PDFFileOptions; pdfOptions.pageRangeToOpen = "all"; pdfOptions.placeAsLinks = false; var idoc = app.open(File(folderPath + "/" + oldPdfName), DocumentColorSpace.CMYK); app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS; function getColor(pathItem) { var isRightColor; if (pathItem.strokeColor instanceof SpotColor) { var strokeColorName = pathItem.strokeColor.spot.name; if (strokeColorName === "Diecut") { isRightColor = "macColor"; } else if(strokeColorName === "PFLW"){ isRightColor = "newPcColor"; } } return isRightColor; } var doc = app.activeDocument; var artb = doc.artboards; var artLayer = doc.layers[0]; var boardCount = artb.length; var glen = artLayer.groupItems; var pathColor; var firstTopGroup = artLayer.groupItems[glen.length-1]; var firstGroupPaths; if(boardCount === 1){ firstGroupPaths = artLayer.pathItems; }else{ var firstClipGroup = firstTopGroup.groupItems[0]; firstGroupPaths = firstClipGroup.pathItems; } for (var i = firstGroupPaths.length-1; i >=0; i--) { var firstGroupPathItem = firstGroupPaths[i]; if (getColor(firstGroupPathItem ) === "macColor"){ pathColor = "macColor"; break; } else if (getColor(firstGroupPathItem ) === "newPcColor"){ pathColor = "newPcColor"; break; } } for(var u = glen.length-1; u>=0; u--){ var topGroup = artLayer.groupItems[u]; var paths; if(boardCount === 1){ paths = artLayer.pathItems; }else{ var clipGroup = topGroup.groupItems[0]; paths = clipGroup.pathItems; } var whiteRectangles = []; for (var i = paths.length-1; i >=0; i--) { var pathItem = paths[i]; if (pathColor === "macColor"){ if(getColor(pathItem) === "macColor"){ if(pathItem.pathPoints.length === 4){ whiteRectangles.push(pathItem); }else{ pathItem.remove(); } } } else if(pathColor === "newPcColor"){ if(getColor(pathItem) === "newPcColor"){whiteRectangles.push(pathItem);} } else if(typeof pathColor === 'undefined'){ if(pathItem.pathPoints.length === 4){ if(pathItem.strokeColor.cyan == 0 && pathItem.strokeColor.magenta == 0 && pathItem.strokeColor.yellow == 0 && pathItem.strokeColor.black == 0){ whiteRectangles.push(pathItem); } } } } if(whiteRectangles.length > 0){ for (var a=0; a<whiteRectangles.length; a++) { whiteRectangles[a].selected = true; var pathBds = whiteRectangles[a].geometricBounds; whiteRectangles[a].remove(); artb.add(pathBds); }} } for(var j=0; j<boardCount; j++){ artb[0].remove (); } function saveAsPDF() { var pdfFile = new File(folderPath + "/" + newPdfName + ".pdf"); var pdfOptions = new PDFSaveOptions(); pdfOptions.compatibility = PDFCompatibility.ACROBAT5; pdfOptions.generateThumbnails = true; pdfOptions.preserveEditability = true; pdfOptions.preset = "[High Quality Print]"; //High Quality Print, Smallest File Size app.activeDocument.saveAs(pdfFile, pdfOptions); } saveAsPDF(); doc.close();
... View more
May 12, 2024
04:16 PM
You've been a great help. Thank you for sharing your knowledge and solving my problem.
... View more