ExtendScript – Illustrator: How to Zip Folder

How to zip a folder in illustrator. This takes the help of an apple script. //Part 1: Extendscript looks like this //1. Get terminal command in form of string  var zipTerminalCommand = terminalCmdToZip(); //2. export terminal command string to a text doc sendToClipboardDoc(zipTerminalCommand) //3. Run apple script app to use terminal command //Change the "YourUserName" part myAppleScriptPath = "/Users/YourUserName/Desktop/YourAppleScript.app" runAppleScript(myAppleScriptPath) //========================================= // FUNCITONS FOR … Continue reading ExtendScript – Illustrator: How to Zip Folder

ExtendScript – Illustrator: Make new document

How to make a new document in illustrator with extendscript alert("making new artboard!") var width = 100 var height = 500 var newDoc = app.documents.add(DocumentColorSpace.RGB, width, height, 1); // source: // https://stackoverflow.com/questions/60960165/when-adding-a-document-in-adobe-illustrators-extendscript-is-there-a-way-to-set Tags: Scripts, adobe illustrator scripting,

ExtendScript – Illustrator : Change artboard size

How to change artboard size with ExtendScript in Illustrator //change artboard size. changeCurrentArtboardSize([640,480]) function changeCurrentArtboardSize(size){     alert("changing artboard size");     activeDocument.artboards.setActiveArtboardIndex(2);//change which artboard you want to crop     var newWidth = new UnitValue (size[0], "px");     var newHeight = new UnitValue (size[1], "px");     newWidth = newWidth.as("px");     newHeight = -newHeight.as("px");//as px not needed but i'll keep it in case i want to reference later.     activeDocument.artboards[0].artboardRect = [0,0,newWidth,newHeight]; }// //end function Tags: Adobe illustrator scripting

ExtendScript – Reveal in finder

How to reveal a folder in finder with ExtendScript var revealThisInFinder = "~/Desktop/myFolderName" revealFolder(revealThisInFinder); function revealFolder(folderPath){     var cleanFolderPath = Folder(folderPath).fsName;//sometimes we get '~/Desktop/Folder/NextFolder'. The '~' path won't work for terminal. This changes it back to "Users/userName/Desktop" format     var terminalCommand = 'cd "' + cleanFolderPath + '" && open .';     //app.system(terminalCommand)//photoshop     var result = system.callSystem(terminalCommand)//after effects    //return result; }// //end function tags: terminal, command line, photoshop ExtendScript, adobe after effects ExtendScript, scripting