Finally! Someone covering this topic that explains it in a format even I can follow! I write (try to write) scripts for Illustrator to speed up workflows at my job. I've been able to create some really helpful ones that do great in v27. However, as I try to refine them, or adapt them to the newer releases, they break down. I just don't have a deep enough understanding to debug what's happening and I really want to get comfortable in this area.
This my first tutorial of this series. Excellently done -- the information, logic, clarity and pace. I'm looking forward to learning how to recursively sort (or rename) layers, sublayers and/or objects (illustrator).
WOW!!!! Very good, very well explained, very detailed and didactic step-by-step. Congratulations on the work!! I'm learning how to create Scripts to automate some tasks in InDesign. Thanks!
@@wc7 great, i have been doing workflow automation for the company i work for and learning javascript in which i am not really proficient as yet, however i get quite a lot done by mixing js, executeMenuItem and DoScript actions. That said, i need to get better handle on js as well. I may came back with some questions in a moment.
I have been working on illustrator The most time taking process for me is not making designs but it is preparing files ready for print. As I need to fullfill below function but a script would make it far more faster as they do not require any human intervention function It is adding crop marks Placing at the top corner bleed - File name - Dimension(option to change unit) - Material as defined Convert All text to outline. Export to JPEG(for reference), PDF custom preset selection option and TIFF. Check Image resolutions,colour space and alert if not in correct colour space and/or resolution. We currently use two scripts and manual checking and manual typing of the size and file name. Use asset export and manually convert text to outline.
That's ambitious but certainly all possible in a single script. I've made similar solutions. Is this something you are writing the code for now? Or planning to begin? Any questions let me know. I also make custom scripts for a fee.
@@wc7 I am trying to write the code referring to your video as i do not understand coding trying to mix your scripts will update you on progress soon.🤞
Can adobe scripta use es6? For example , do const and let work ? Higher order array methods ? And what about event listeners, does it have to use onclick or can it be addEventListener('click',...)?
Adobe extendscript is based on ESS3 (2009), so no const and no let. Higher events are based on ESS5 (2015). Lastly app.addEventListerner(add: "click"...
@@wc7 thanks so much for your reply. My use case is that I have a text object on my artboard and each time the file opens or prints I want to randomize the text content of the text obj feom an array of 5 possible strings. Is this possible with scripts ? Or would the script need to be opened in AI and run every time to swap out the strings?
Thinking an array of possible strings and then set textRange.contents = arr[randomIndex]? Just not sure if it will work when the file is eventually a pdf and I don't have access to the app object if it's not opening in illustrator
I have struggled with trying to force validation scripts within fields to run when opening an adobe pro form. Everything I try does not work. I can get code to check the fields but it does not force the validation script to run. I have several date fields with different compliance rules. When a form is closed and reopens, I need the validation code to run again. This way, dates that are compliant today, may not be compliant tomorrow and the validation field will alert the user. I just can't get the validation code to run again, unless I change the date within the field. This is annoying. Can you help?
its important when you are teaching to use complete variable names ( var group; ) instead of ( var g; ) the shortcuts are suitable for work, not for teaching . the reasons are many , one of them is : "new" students of you does not have the same flexibly of memorizing and moving trough the code text as an experienced programmer have.
Hi, William , Thanks for your tutorial, that's what i"m looking for. And can i know what extension you use to to pop up the infor box when you type "new Window " at 3:19 ....? Thanks a lot
Do you mean the auto-fill in VSCode? Two things help. 1. The ExtendScript Debugger for VSCode: marketplace.visualstudio.com/items?itemName=Adobe.extendscript-debug (also can save jsxbin, SHIFT-CTRL-J on Windows, or right-click, at the bottom) And 2. "Types for Adobe": github.com/aenhancers/Types-for-Adobe This second one can be confusing how to use and there are multiple examples from different users, some more complicated than others. All you need is the zip from the link, then in each app subfolder (Illustrator, InDesign, Photoshop, etc.) make a subfolder "types". Put the contents of the zip "shared" folder into each "types" subfolder. Then to the same folder, copy the files specific to each app, which there are subfolders for inside the zip.
@@wc7 THANKS SO much William , and do you know where i can find a document ion detail about the properties about the window, panel, group ? For example, i will change the size of the window , etc.
@@kevinhe8188 There are links in the description of this video to ExtendScript resources. Also good is the Adobe forum. Free to join. Lots to learn there. community.adobe.com/ There are topic buttons. I usually have "Scripting" or "Actions and scripting" selected to focus on those topics.
Hello William , first of all i want to thank you for your awesome work. What do you think about a Grommet Mark Script with the option to work on a Freeform like a Circle?
Can this also work if I need to iterate, let's say, layers' "layer style" effect, and add some function TO it? For example to add a curvature parameter on gradient overlay style in the "layer style" window
I'm not quite sure what you're asking. I am planning a tutorial that does show how to walk through a document's layers, so each can be modified (tutorial will be for changing layer names). The style applied to a layer is not directly exposed to the scripting language, so manipulating layer styles in script is going to be a steep climb, if at all possible. ExtendScript has its limits unfortunately. Also it's unclear if you mean to modify Photoshop's interface. To my knowledge, the only UI elements a script can modify are its UI, not anything part of the normal Photoshop interface.
It is possible. I can add to my list of future videos one showing this topic. For now it's too much for a comment reply, but there is a great resource linked in the description I'll repeat here: creativepro.com/files/kahrel/indesign/scriptui.html On this page is a link to download a PDF by Peter Kahrel that is a fantastic reference to all things ScriptUI related, including adding images to the interface. Highly recommended.
Acrobat can be scripted like the others, but I haven't explored doing scripts in Acrobat yet. I can add it to my to-do list, and eventually make tutorials for what I discover. What kind of scripts are you looking for? Meaning, what's a simple example of what an Acrobat script could do, that would be a time-saver or solve a problem? For me it's always been "Necessity is the mother of invention." Scripts I've made come from my own need for them, or the needs of others, who contact me to ask "do you have a script to do...?" I start simple, and build from there, but it always starts with one little problem to solve, and make a script to solve it. Then a bigger problem, and on, and on to better scripts.
@@wc7 I appreciate your quick reply! Well, one need I have is to take existing forms and populate with client data that exists somewhere, like on a json file. I wonder if it were possible to maybe put script in a button that pulls the info from the json file and populates to the pdf.
@@bredmond812 What you describe should be possible. I do similar things in InDesign. In fact, my scripts that save settings all use JSON to do it. One reason I haven't done more in Acrobat before now is the documentation was so crappy compared to what's available for the other apps. But your comment made me think to go check if there's anything new. Yes, there is, just last December in fact. I haven't studied thoroughly yet, but on quick glance the new materials look promising. With better docs now, I'll explore what can be done. On my to-do list anyway (it's getting long!). Go here to download the new 2021 guide PDFs and other materials: opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/documentation.html
@@bredmond812 I do not believe Acrobat uses scriptUI like the other apps. The few times I've played with JS in Acrobat, it works by modifying the menu to add items that launch JS code.
This is great, as a person that doesn't know any javascript im really struggling to get my head around the relevent basics for Photoshop. All the videos online which teach javascript seem to teach things which aren't relevent. It would be great if you could do a video on this
I will create a new tutorial series aimed at absolute beginners that starts from the very beginning and is limited to the most basic JavaScript features needed to script Adobe apps, or do simple tasks in a browser. Prior to this I wasn't thinking such a tutorial series would have much demand, there being so many other JS tutorials on TH-cam already, but your comment makes me realize, yes, too many tutorials focus on newer ES6 features that Adobe apps don't even understand. Besides, throwing all that at a new student isn't helpful. I'll keep to the basics that get the job done. Thank you for the feedback. Much appreciated.
@@wc7 I have been struggling for weeks but I seem to find alot of outdated data and code. This would be extremely helpful as I only know HTML, CSS, and the basics of python. Scripting for adobe products is a totally different ball park. A javascript series for adobe apps would be amazing!
@@CallMeCameroniMacaroni This is a JavaScript series for Adobe apps. However, it is aimed at users with prior JavaScript experience. So it doesn't go into details of the language as much as it could, although now and then it does highlight and explain language features of interest to the particular topic. I've had requests for a basic JavaScript tutorial series which I will begin shortly. I'll post back here when the first episode launches. Thank you for the feedback.
@@peteraylward443 I do not. These tutorials are for users who know JavaScript, but not ExtendScript specific to Adobe scripting. I haven't made a JavaScript tutorial only because there are very many already. Search TH-cam for "JavaScript" and you'll see what I mean. Those should help you. But I suppose if viewers want my kind of tutorial about JavaScript, I can start a series for that too.
Huge thanks for the tutorial! I want to modify default InDesign script “PlaceMultipagePDF.jsx” to A. Scale the placed PDF page for some percentage. B. Resize the bounding box frame for each placed page to crop any printing marks and prevent overlapping.
I have tutorials about scaling but those are Photoshop. InDesign is similar but there are some things to consider. 1. All placed graphics go into a container. This is a 'Rectangle' object. To crop what it contains, simply change the property 'geometricBounds'. 2. The content inside the rectangle is usually the first item of the 'allGraphics' collection of the rectangle. So I typically get 'allGraphics[0]'. This is a 'Graphic" object. This has a method 'resize'. Using it looks like this (once you define 'scale' the amount to scale the graphic): graphic.resize( BoundingBoxLimits.GEOMETRIC_PATH_BOUNDS, AnchorPoint.BOTTOM_CENTER_ANCHOR, ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, [scale, scale] ); I can make another tutorial that shows the steps in more detail.
Thank you, for the response, William! @@wc7 I’ll try to get grasp of it in InDesign with your tutorials. Specific lesson however would be beneficial. Since it could be useful in various real-world situations.
var doc = app.activeDocument; var bounds = [ doc.marginPreferences.top, doc.marginPreferences.left, doc.documentPreferences.pageHeight - doc.marginPreferences.bottom, doc.documentPreferences.pageWidth - doc.marginPreferences.right ]; var rect = doc.rectangles.add(); rect.geometricBounds = bounds; Available properties of the object 'Rectangle' see www.indesignjs.de/extendscriptAPI/indesign-latest/#Rectangle.html#d1e217687
Inserting text content depends on the application. A script can't "generate" text. You have to either feed it the text, whether lorem ipsum, or not, or hard-code the text into the script.
See the description for many links to ExtendScript resources. Here is direct link to documentation of built-in Folder object: extendscript.docsforadobe.dev/file-system-access/folder-object.html
Steps in this particular video should work in Premiere. I only say "should" because I don't write scripts for Premiere. Even so I am pretty sure it will work the same because it does across other Adobe apps. Other tutorials about automating other apps won't apply to Premiere.
Thanks for the video. I was following along, and added some of the extensions you mentioned. My setup in Vs code isn’t giving me the autosuggestions and info that it gives you. Can you share how you get the autocomplete options and explanations of functions and elements you’re working with? Thanks!
This was fantastic, thank you so much! I'm doing some scripting for Adobe Illustrator and I want to give users a chance to see some of the script's variable values before it runs, for confirmation purposes. It seems like Adobe's scripting doesn't support nesting variables inside strings like you can in javascript, like `value A is: ${valueA}`, is there a way to easily add variable values to a panel or window?
No not possible in Adobe Extendscript which is JS ES3 (1999), so it is missing many newer features found in ES6 (2015) and newer versions, the string substitution just one example.
@@wc7 thanks for replying! hm that's a bummer. So there's no way to display a variable in a window to a user currently? It's possible with an alert, but the control types available to add to a Window are limiting. I'm surprised that even passing a string variable in doesn't work. I'm surprised there isn't some disable/enable attribute on the edittext controltype elements. It would be nice to at least show a variable with var group1 = group.add("edittext", undefined, myVar) and then just do group1.editenabled = false.
@@sophie5328 UI controls can be enabled/disabled. Each has the property 'enabled'. Set true or false as desired. Disabled elements are gray and obviously can't be clicked or edited. Also it is possible to update the content of the UI text any time before clicking OK or cancel or otherwise closing the window. Have a UI control 'statictext' and update the .text property to whatever you want it to show. Study more of the tutorials and you'll see some of this in action. There just isn't the ES6 string substitution feature, unrelated to all you refer to in your latest reply.
@@wc7 I somehow completely missed the 'enabled' property, I see it in the documentation now. I'll definitely check out the rest of your tutorials and keep an eye out, thank you so much for such in depth responses!
How do I get VS Code to autocorrect for Adobe Scripting? I don't know all the methods inside each object, and cannot find any documentation to help with autocomplete when I start typing. Any assistance would be awesome!
Fantastic series and thank you for taking the time to share your knowledge! Any plans for creating tutorials on UXP and JS inside Photoshop? The space is very empty on TH-cam and would love to hear your knowledge on the subject 🙏
Yes I do hope to cover these topics in the future. My problem is the great response to my ExtendScript tutorials and finished scripts have spawned an overwhelming stream of requests for scripts and help with scripting that I am struggling to keep up with. This is keeping me from UXP research I need to do. I have to be good at UXP myself before I can teach others. Thank you for the nudge. I will probably have to simply put the other off and get the UXP work moving forward soon. It's true -- now is the time to fill that void.
There is much about JS on TH-cam. Search for "JavaScript Tutorial" you should find plenty. Here is one from a channel I enjoy: th-cam.com/video/W6NZfCO5SIk/w-d-xo.html However, to learn JS for doing Adobe apps, it has another challenge. The scripting language "ExtendScript" that Abobe apps use is based on very old JS prior to 2009. Many times tutorials show techniques only modern JS can do, and the same techniques don't work in ExtendScript. Too much to explain in a comment reply. Much of learning how Adobe JS behaves compared to modern JS is trial and error.
@@dariastroeva6779 Another thing that is helpful is old books on JavaScript. Look for used books that were published before 2009. For one because these won't talk about modern features Adobe apps can't do anyway, so no need to consume brain space on the topics. Likely out-of-date books will be simpler as well for the same reason. Should be cheap too. Modern JS has added a lot of features that do make it powerful, but it's also more to think about. Starting out with old JS is a good strategy anyway. Then build from there.
You are trying to write code for this? There are two ways to save PNG in AI script. One is "image capture". The other, export. The advantage of image capture is that you can specify the resolution. Export only does 72 ppi. So when I use it, I set a scale factor to arrive at the desired pixel dimensions, for example, to make it 300 ppi. Here is some example code showing both methods: var doc = app.activeDocument; // SAVE PNG (IMAGE CAPTURE) var filePng = new File(doc.fullName.fullName.replace(/\.ai$/i, ".png")); var imageCaptureOptions = new ImageCaptureOptions(); imageCaptureOptions.resolution = 72; imageCaptureOptions.antiAliasing = true; imageCaptureOptions.transparency = false; doc.imageCapture(filePng, doc.geometricBounds, imageCaptureOptions); // SAVE PNG-24 var filePng = new File(doc.fullName.fullName.replace(/\.ai$/i, ".png")); var exportOptions = new ExportOptionsPNG24(); exportOptions.antiAliasing = true; exportOptions.artBoardClipping = true; exportOptions.matte = true; exportOptions.transparency = false; // This is how you get different resolution: // Scale it. Always outputs 72 ppi. So 4x = 288 ppi // 300 ppi is 416.6666% // exportOptions.horizontalScale = 416.6666; // exportOptions.verticalScale = 416.6666; exportOptions.horizontalScale = 100; exportOptions.verticalScale = 100; doc.exportFile(filePng, ExportType.PNG24, exportOptions);
Once I conquer CEP myself likely I'll add episodes about how to do it. Someday. The only other sources of content on the subject are channels Davide Barranca and NT Productions. Davide YT content is more about UXP (replaces CEP) but he has other non content off YT about CEP.
Yep. Started in BASIC in the 80s, then 6502 assembly on Commodore 64, then C and C++ on PC. Later (and still today) PHP making websites hosted on Apache. Of them all JavaScript is my favorite. And just so you know, these tutorials are not specific to Windows. VS Code runs on all platforms. I use it on macOS as well. I just use Windows for the tutorials because it's where I use VS Code the most, for Adobe scripts and PHP/JS/HTML/CSS for web apps and sites.
2 ปีที่แล้ว +2
@@wc7 I use linux, so i have ilustrator in windows vbox, i only come to see how to run script in ilustrator because i have no idea how to add this script to adobe ilustrator.. And, big, big respect for using PHP, my favorite langulage! IDK why is now react/nextJS thet popular..
@ I think VS Code runs on Linux too. Regarding React or any other JS "framework" I don't care for any of them. Plain Vanilla JavaScript works just fine for me. I have my own libraries of polished functions that I combine as needed.
2 ปีที่แล้ว
@@wc7 Of course vs code runs on linux, but adobe programs do not.
Thanks for the Video. What is requirement for learning Adobe Script Tutorial. I'm interest but I didn't any knowledge / experience any language or coding... I only know the InDesign very well.
The only prerequisite is understanding basic JavaScript. But note, Adobe script language is based on old JavaScript prior to 2009. So it helps to read old books rather than the latest materials (either books or online) that cover complex features that have been added to the language in recent releases that have no relevance to Adobe scripting. I recommend finding used books on the subject with publish dates prior to 2009. Usually you can get them for a reasonable price as well.
The two are completely different. One a description of artwork. The other instructions for a computer to execute. I can't image what the translation would be. JavaScript to draw artwork? I don't call things impossible, but is it practical, useful? And really worth the time it would take.
@@maninzn The same AI file every time the script is executed? Serialize the AI file into a string value. Write the string value to a file within the script when executed. Beyond that (making decisions about how or what to draw) is beyond my interest, schedule, and likely ability.
I totally agree with you on the topics of declaring variables on top and prefixes ( Although I do 1 for visibility (l = local or g = global) and 1-2 letters for type, so something like lbOK. I don't know JScript (I did something with it 20 years ago ... let's not count that) but I can watch other videos for it. I did expect that you show how to get the script that it appears under "Scripts" ... maybe it's a no-brainer if I'd have known more about JS... ^^ Never, mind, I'm off downloading the 2 programs and maybe it will be clear how the scripts appear...
I have other videos about installing scripts. Links should have been in the description. Links are there now. I'll add to the other tutorial descriptions as well. Here are the video links repeated... Illustrator macOS: th-cam.com/video/DGMYAdv4N4k/w-d-xo.html Illustrator Windows: th-cam.com/video/_RImYICaoFw/w-d-xo.html InDesign macOS: th-cam.com/video/JdP1iXS9ZiY/w-d-xo.html InDesign Windows: th-cam.com/video/gACWRCOxvSY/w-d-xo.html Photoshop macOS: th-cam.com/video/b_kCiXFTNGk/w-d-xo.html Photoshop Windows: th-cam.com/video/ZVYiXP7h6Rw/w-d-xo.html More about installing scripts both macOS and Windows: www.marspremedia.com/software/how-to-adobe-cc Other useful scripts for Adobe Creative Cloud applications: www.marspremedia.com/software
@@langaliyamukesh962 OK but still not completely sure what you mean by "auto frames". I can guess maybe similar to other requests I've had for how to import images into a mask like I show in tutorial #8 (th-cam.com/video/og7kH_-CkzI/w-d-xo.html) except bring in multiple images into various sized masks. I am planning a tutorial video on how to do that. Should be soon.
See tutorial #5: th-cam.com/video/IMzRTPr19Bs/w-d-xo.html Use that to open a folder. Only difference is process function. Instead for loop, use "files[0]". First element of file array is first file found. First element of array is index zero.
It is possible. I haven't used images in my scripts only because I've never felt the need to. I like my interfaces simple, but that's just me. There is a great ScriptUI guide by Peter Kahrel every ExtendScript programmer should consult. The guide includes discussion of using images for UI buttons. Get the PDF here: creativepro.com/files/kahrel/indesign/scriptui.html
Finally! Someone covering this topic that explains it in a format even I can follow! I write (try to write) scripts for Illustrator to speed up workflows at my job. I've been able to create some really helpful ones that do great in v27. However, as I try to refine them, or adapt them to the newer releases, they break down. I just don't have a deep enough understanding to debug what's happening and I really want to get comfortable in this area.
This my first tutorial of this series. Excellently done -- the information, logic, clarity and pace. I'm looking forward to learning how to recursively sort (or rename) layers, sublayers and/or objects (illustrator).
Nice pace, excellent delivery, soothing voice. An easy subscribe!
WOW!!!! Very good, very well explained, very detailed and didactic step-by-step.
Congratulations on the work!!
I'm learning how to create Scripts to automate some tasks in InDesign.
Thanks!
Thank you, I'm glad it helped.
I'm starting to learn JS just to write some scripts for my daily work. Thanks for the video, you have a new subscriber!
Thank you.
Thanks, really helpful, your presentation is clear , detailed and easy to understand, appreciated.
Thanks. I'm glad it's well-received. I've got #2 and #3 done, working on #4 now. There will be many.
@@wc7 great, i have been doing workflow automation for the company i work for and learning javascript in which i am not really proficient as yet, however i get quite a lot done by mixing js, executeMenuItem and DoScript actions. That said, i need to get better handle on js as well. I may came back with some questions in a moment.
This was great. I have been looking for this video for quite some time.
Glad you enjoyed it!
Great tutorial!
I like your lesson, easy to understand.
Please add more for ilustrator script basic tutorial
OK I will make note to do add specific Illustrator scripts. Not all, but many of the videos so far also apply to Illustrator as well.
First Illustrator tutorial is live this morning: th-cam.com/video/b2afLAI-vvc/w-d-xo.html
Super awesome tutorial, why doesn't this video have one million views, yet. I would love tutorials for After effects scripting for sure.
Thank you.
Thanks. Is there tutorial how to create interactive button using script?
It would be great to know various options for working with fields in both Adobe Acrobat and AEM (Adobe Experience Manager)
Thanks for tutorial William.
You're welcome. Glad you enjoyed it.
I have been working on illustrator
The most time taking process for me is not making designs but it is preparing files ready for print.
As I need to fullfill below function but a script would make it far more faster as they do not require any human intervention function
It is adding crop marks
Placing at the top corner bleed - File name - Dimension(option to change unit) - Material as defined
Convert All text to outline.
Export to JPEG(for reference), PDF custom preset selection option and TIFF.
Check Image resolutions,colour space and alert if not in correct colour space and/or resolution.
We currently use two scripts and manual checking and manual typing of the size and file name. Use asset export and manually convert text to outline.
That's ambitious but certainly all possible in a single script. I've made similar solutions. Is this something you are writing the code for now? Or planning to begin? Any questions let me know. I also make custom scripts for a fee.
@@wc7 I am trying to
write the code referring to your video as i do not understand coding trying to mix
your scripts will update you on progress soon.🤞
@@wc7 Let me know your email so i could drop a mail for requesting a quote.
@@hardikgalaiya8834 Go to my TH-cam channel page. On the About tab is a button that reveals my email address.
Can adobe scripta use es6? For example , do const and let work ? Higher order array methods ?
And what about event listeners, does it have to use onclick or can it be addEventListener('click',...)?
Adobe extendscript is based on ESS3 (2009), so no const and no let. Higher events are based on ESS5 (2015). Lastly app.addEventListerner(add: "click"...
@@wc7 thanks so much for your reply. My use case is that I have a text object on my artboard and each time the file opens or prints I want to randomize the text content of the text obj feom an array of 5 possible strings. Is this possible with scripts ? Or would the script need to be opened in AI and run every time to swap out the strings?
Thinking an array of possible strings and then set textRange.contents = arr[randomIndex]?
Just not sure if it will work when the file is eventually a pdf and I don't have access to the app object if it's not opening in illustrator
@@clevermissfox text should work ok.
I don't see why not
I have struggled with trying to force validation scripts within fields to run when opening an adobe pro form. Everything I try does not work. I can get code to check the fields but it does not force the validation script to run. I have several date fields with different compliance rules. When a form is closed and reopens, I need the validation code to run again. This way, dates that are compliant today, may not be compliant tomorrow and the validation field will alert the user. I just can't get the validation code to run again, unless I change the date within the field. This is annoying. Can you help?
its important when you are teaching to use complete variable names ( var group; ) instead of ( var g; )
the shortcuts are suitable for work, not for teaching .
the reasons are many , one of them is : "new" students of you does not have the same flexibly of memorizing and moving trough the code text as an experienced programmer have.
do you any books that you sale? Also, do you have any examples for pdf form using dependent dropdown? thank you
No books here just videos. PDF form are you referring to Acrobat? I don't write scripts for Acrobat, only Illustrator, InDesign, and Photoshop.
Hi, William , Thanks for your tutorial, that's what i"m looking for.
And can i know what extension you use to to pop up the infor box when you type "new Window " at 3:19 ....?
Thanks a lot
Do you mean the auto-fill in VSCode? Two things help. 1. The ExtendScript Debugger for VSCode:
marketplace.visualstudio.com/items?itemName=Adobe.extendscript-debug
(also can save jsxbin, SHIFT-CTRL-J on Windows, or right-click, at the bottom)
And 2. "Types for Adobe":
github.com/aenhancers/Types-for-Adobe
This second one can be confusing how to use and there are multiple examples from different users, some more complicated than others. All you need is the zip from the link, then in each app subfolder (Illustrator, InDesign, Photoshop, etc.) make a subfolder "types". Put the contents of the zip "shared" folder into each "types" subfolder. Then to the same folder, copy the files specific to each app, which there are subfolders for inside the zip.
@@wc7 THANKS SO much William , and do you know where i can find a document ion detail about the properties about the window, panel, group ? For example, i will change the size of the window , etc.
@@kevinhe8188 There are links in the description of this video to ExtendScript resources. Also good is the Adobe forum. Free to join. Lots to learn there.
community.adobe.com/
There are topic buttons. I usually have "Scripting" or "Actions and scripting" selected to focus on those topics.
@@wc7 Thanks again. You are so gorgeous.
I have a tutorial now showing how to set up IntelliSense for ExtendScript:
th-cam.com/video/OUbjec0OSX4/w-d-xo.html
awesome tutorials. please provide Bash scripting tutorials if possible. Have a great day.
Can you do tutorial on how encrypt js code for adobe ? And how add it in interface ?
Hello William ,
first of all i want to thank you for your awesome work. What do you think about a Grommet Mark Script with the option to work on a Freeform like a Circle?
Can this also work if I need to iterate, let's say, layers' "layer style" effect, and add some function TO it? For example to add a curvature parameter on gradient overlay style in the "layer style" window
I'm not quite sure what you're asking. I am planning a tutorial that does show how to walk through a document's layers, so each can be modified (tutorial will be for changing layer names). The style applied to a layer is not directly exposed to the scripting language, so manipulating layer styles in script is going to be a steep climb, if at all possible. ExtendScript has its limits unfortunately. Also it's unclear if you mean to modify Photoshop's interface. To my knowledge, the only UI elements a script can modify are its UI, not anything part of the normal Photoshop interface.
can we add an image in the interface background, like a logo for example?
It is possible. I can add to my list of future videos one showing this topic. For now it's too much for a comment reply, but there is a great resource linked in the description I'll repeat here: creativepro.com/files/kahrel/indesign/scriptui.html
On this page is a link to download a PDF by Peter Kahrel that is a fantastic reference to all things ScriptUI related, including adding images to the interface. Highly recommended.
The application I world like to code for is acrobat. I mean can pdf's themselves have scripts and events ?
Acrobat can be scripted like the others, but I haven't explored doing scripts in Acrobat yet. I can add it to my to-do list, and eventually make tutorials for what I discover. What kind of scripts are you looking for? Meaning, what's a simple example of what an Acrobat script could do, that would be a time-saver or solve a problem? For me it's always been "Necessity is the mother of invention." Scripts I've made come from my own need for them, or the needs of others, who contact me to ask "do you have a script to do...?" I start simple, and build from there, but it always starts with one little problem to solve, and make a script to solve it. Then a bigger problem, and on, and on to better scripts.
@@wc7 I appreciate your quick reply! Well, one need I have is to take existing forms and populate with client data that exists somewhere, like on a json file. I wonder if it were possible to maybe put script in a button that pulls the info from the json file and populates to the pdf.
@@wc7 I wonder if it uses ScriptUI and just how the code gets placed into the pdf.
@@bredmond812 What you describe should be possible. I do similar things in InDesign. In fact, my scripts that save settings all use JSON to do it. One reason I haven't done more in Acrobat before now is the documentation was so crappy compared to what's available for the other apps. But your comment made me think to go check if there's anything new. Yes, there is, just last December in fact. I haven't studied thoroughly yet, but on quick glance the new materials look promising. With better docs now, I'll explore what can be done. On my to-do list anyway (it's getting long!). Go here to download the new 2021 guide PDFs and other materials: opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/documentation.html
@@bredmond812 I do not believe Acrobat uses scriptUI like the other apps. The few times I've played with JS in Acrobat, it works by modifying the menu to add items that launch JS code.
THX,i love it.
This is great, as a person that doesn't know any javascript im really struggling to get my head around the relevent basics for Photoshop. All the videos online which teach javascript seem to teach things which aren't relevent. It would be great if you could do a video on this
I will create a new tutorial series aimed at absolute beginners that starts from the very beginning and is limited to the most basic JavaScript features needed to script Adobe apps, or do simple tasks in a browser. Prior to this I wasn't thinking such a tutorial series would have much demand, there being so many other JS tutorials on TH-cam already, but your comment makes me realize, yes, too many tutorials focus on newer ES6 features that Adobe apps don't even understand. Besides, throwing all that at a new student isn't helpful. I'll keep to the basics that get the job done. Thank you for the feedback. Much appreciated.
@@wc7 I have been struggling for weeks but I seem to find alot of outdated data and code. This would be extremely helpful as I only know HTML, CSS, and the basics of python. Scripting for adobe products is a totally different ball park. A javascript series for adobe apps would be amazing!
@@CallMeCameroniMacaroni This is a JavaScript series for Adobe apps. However, it is aimed at users with prior JavaScript experience. So it doesn't go into details of the language as much as it could, although now and then it does highlight and explain language features of interest to the particular topic. I've had requests for a basic JavaScript tutorial series which I will begin shortly. I'll post back here when the first episode launches. Thank you for the feedback.
@@wc7 Did you do a video for absolute beginner? I haven't seen it and am still struggling in a big way.
@@peteraylward443 I do not. These tutorials are for users who know JavaScript, but not ExtendScript specific to Adobe scripting. I haven't made a JavaScript tutorial only because there are very many already. Search TH-cam for "JavaScript" and you'll see what I mean. Those should help you. But I suppose if viewers want my kind of tutorial about JavaScript, I can start a series for that too.
Huge thanks for the tutorial! I want to modify default InDesign script “PlaceMultipagePDF.jsx” to A. Scale the placed PDF page for some percentage. B. Resize the bounding box frame for each placed page to crop any printing marks and prevent overlapping.
I have tutorials about scaling but those are Photoshop. InDesign is similar but there are some things to consider. 1. All placed graphics go into a container. This is a 'Rectangle' object. To crop what it contains, simply change the property 'geometricBounds'. 2. The content inside the rectangle is usually the first item of the 'allGraphics' collection of the rectangle. So I typically get 'allGraphics[0]'. This is a 'Graphic" object. This has a method 'resize'. Using it looks like this (once you define 'scale' the amount to scale the graphic):
graphic.resize(
BoundingBoxLimits.GEOMETRIC_PATH_BOUNDS,
AnchorPoint.BOTTOM_CENTER_ANCHOR,
ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY,
[scale, scale]
);
I can make another tutorial that shows the steps in more detail.
Thank you, for the response, William! @@wc7 I’ll try to get grasp of it in InDesign with your tutorials. Specific lesson however would be beneficial. Since it could be useful in various real-world situations.
can u write a code to create a frame(Rectangle) with the size same as document's margin size. Thank u
var doc = app.activeDocument;
var bounds = [
doc.marginPreferences.top,
doc.marginPreferences.left,
doc.documentPreferences.pageHeight - doc.marginPreferences.bottom,
doc.documentPreferences.pageWidth - doc.marginPreferences.right
];
var rect = doc.rectangles.add();
rect.geometricBounds = bounds;
Available properties of the object 'Rectangle' see www.indesignjs.de/extendscriptAPI/indesign-latest/#Rectangle.html#d1e217687
@@wc7 thank u very much William. I really appreciate it.
How do you generate text to place in the page, like lorem ipsum? Is it possible
Inserting text content depends on the application. A script can't "generate" text. You have to either feed it the text, whether lorem ipsum, or not, or hard-code the text into the script.
Hi, How do you know the Folder object exist? And what arguments each function takes? What documentation can I verify?
See the description for many links to ExtendScript resources. Here is direct link to documentation of built-in Folder object: extendscript.docsforadobe.dev/file-system-access/folder-object.html
Great course! With this by any way work the same for Premiere Pro?
Steps in this particular video should work in Premiere. I only say "should" because I don't write scripts for Premiere. Even so I am pretty sure it will work the same because it does across other Adobe apps. Other tutorials about automating other apps won't apply to Premiere.
Thanks, I appreciate the info! I'll still view the others jus' to know incase I get I'd like to automate some steps@@wc7
Thanks for the video. I was following along, and added some of the extensions you mentioned. My setup in Vs code isn’t giving me the autosuggestions and info that it gives you. Can you share how you get the autocomplete options and explanations of functions and elements you’re working with?
Thanks!
Autocomplete for VS Code is covered in tutorial 13: th-cam.com/video/OUbjec0OSX4/w-d-xo.html
Great! Thank you!
Sir iwant Adobe script select folder and open first jpg image only. pls. Hel me
This was fantastic, thank you so much! I'm doing some scripting for Adobe Illustrator and I want to give users a chance to see some of the script's variable values before it runs, for confirmation purposes. It seems like Adobe's scripting doesn't support nesting variables inside strings like you can in javascript, like `value A is: ${valueA}`, is there a way to easily add variable values to a panel or window?
No not possible in Adobe Extendscript which is JS ES3 (1999), so it is missing many newer features found in ES6 (2015) and newer versions, the string substitution just one example.
@@wc7 thanks for replying! hm that's a bummer. So there's no way to display a variable in a window to a user currently? It's possible with an alert, but the control types available to add to a Window are limiting. I'm surprised that even passing a string variable in doesn't work. I'm surprised there isn't some disable/enable attribute on the edittext controltype elements. It would be nice to at least show a variable with var group1 = group.add("edittext", undefined, myVar) and then just do group1.editenabled = false.
@@sophie5328 UI controls can be enabled/disabled. Each has the property 'enabled'. Set true or false as desired. Disabled elements are gray and obviously can't be clicked or edited. Also it is possible to update the content of the UI text any time before clicking OK or cancel or otherwise closing the window. Have a UI control 'statictext' and update the .text property to whatever you want it to show. Study more of the tutorials and you'll see some of this in action. There just isn't the ES6 string substitution feature, unrelated to all you refer to in your latest reply.
@@wc7 I somehow completely missed the 'enabled' property, I see it in the documentation now. I'll definitely check out the rest of your tutorials and keep an eye out, thank you so much for such in depth responses!
How do I get VS Code to autocorrect for Adobe Scripting? I don't know all the methods inside each object, and cannot find any documentation to help with autocomplete when I start typing. Any assistance would be awesome!
th-cam.com/video/OUbjec0OSX4/w-d-xo.html
Fantastic series and thank you for taking the time to share your knowledge! Any plans for creating tutorials on UXP and JS inside Photoshop? The space is very empty on TH-cam and would love to hear your knowledge on the subject 🙏
Yes I do hope to cover these topics in the future. My problem is the great response to my ExtendScript tutorials and finished scripts have spawned an overwhelming stream of requests for scripts and help with scripting that I am struggling to keep up with. This is keeping me from UXP research I need to do. I have to be good at UXP myself before I can teach others. Thank you for the nudge. I will probably have to simply put the other off and get the UXP work moving forward soon. It's true -- now is the time to fill that void.
Thank you for this video! Could you advise a short free JavaScript course sufficient for better understanding of this material, please?
There is much about JS on TH-cam. Search for "JavaScript Tutorial" you should find plenty. Here is one from a channel I enjoy: th-cam.com/video/W6NZfCO5SIk/w-d-xo.html
However, to learn JS for doing Adobe apps, it has another challenge. The scripting language "ExtendScript" that Abobe apps use is based on very old JS prior to 2009. Many times tutorials show techniques only modern JS can do, and the same techniques don't work in ExtendScript. Too much to explain in a comment reply. Much of learning how Adobe JS behaves compared to modern JS is trial and error.
@@wc7 thank you so much for your answer! ❤️ I know it's a lot to learn, just have to start from something!
@@dariastroeva6779 Another thing that is helpful is old books on JavaScript. Look for used books that were published before 2009. For one because these won't talk about modern features Adobe apps can't do anyway, so no need to consume brain space on the topics. Likely out-of-date books will be simpler as well for the same reason. Should be cheap too. Modern JS has added a lot of features that do make it powerful, but it's also more to think about. Starting out with old JS is a good strategy anyway. Then build from there.
This extension is deprecated as it is no longer being maintained. Master Script is obsolete, what should we do?
Beautify
Ok
@@elyasforohar9553 ok
Hi! Do you have a tutorial for script to check printed pdf pagination from indesign? :)
I guess the answer is no, I don't have a script for that. I'm not sure what it means "check printed pdf pagination". Please explain.
i need help from you , i want to convert illustrator file into png with same resolution in after effects
You are trying to write code for this? There are two ways to save PNG in AI script. One is "image capture". The other, export. The advantage of image capture is that you can specify the resolution. Export only does 72 ppi. So when I use it, I set a scale factor to arrive at the desired pixel dimensions, for example, to make it 300 ppi. Here is some example code showing both methods:
var doc = app.activeDocument;
// SAVE PNG (IMAGE CAPTURE)
var filePng = new File(doc.fullName.fullName.replace(/\.ai$/i, ".png"));
var imageCaptureOptions = new ImageCaptureOptions();
imageCaptureOptions.resolution = 72;
imageCaptureOptions.antiAliasing = true;
imageCaptureOptions.transparency = false;
doc.imageCapture(filePng, doc.geometricBounds, imageCaptureOptions);
// SAVE PNG-24
var filePng = new File(doc.fullName.fullName.replace(/\.ai$/i, ".png"));
var exportOptions = new ExportOptionsPNG24();
exportOptions.antiAliasing = true;
exportOptions.artBoardClipping = true;
exportOptions.matte = true;
exportOptions.transparency = false;
// This is how you get different resolution:
// Scale it. Always outputs 72 ppi. So 4x = 288 ppi
// 300 ppi is 416.6666%
// exportOptions.horizontalScale = 416.6666;
// exportOptions.verticalScale = 416.6666;
exportOptions.horizontalScale = 100;
exportOptions.verticalScale = 100;
doc.exportFile(filePng, ExportType.PNG24, exportOptions);
se Eu instalar esse plug-in consigo gravar e executar pelo windows VBA?
No. This is ExtendScript. Runs in Adobe applications.
The ExtendScript Debugger não funciona em Apple Silicon. Não existe um plugin substituto para esse caso? Ou uma atualização? Obrigado ☺️
VS Code? Don't know. I program on Windows. Test on both.
@@wc7 Yes, VSCode for MacOs. I have Windows too. I will try there!!
Thank you very much!
This is great content for simple scripting, do you recommend any TH-cam training for CEP Extensions for Illustrator?
Once I conquer CEP myself likely I'll add episodes about how to do it. Someday. The only other sources of content on the subject are channels Davide Barranca and NT Productions. Davide YT content is more about UXP (replaces CEP) but he has other non content off YT about CEP.
Would love a tutorial for building an InDesign script to place an object from a library.
I've added it to my list of future tutorials.
I clear to see you use other langulages then js... And it's clear to see i do not use adobe or even windows, but i must for money this time.. 🤣
Yep. Started in BASIC in the 80s, then 6502 assembly on Commodore 64, then C and C++ on PC. Later (and still today) PHP making websites hosted on Apache. Of them all JavaScript is my favorite. And just so you know, these tutorials are not specific to Windows. VS Code runs on all platforms. I use it on macOS as well. I just use Windows for the tutorials because it's where I use VS Code the most, for Adobe scripts and PHP/JS/HTML/CSS for web apps and sites.
@@wc7 I use linux, so i have ilustrator in windows vbox, i only come to see how to run script in ilustrator because i have no idea how to add this script to adobe ilustrator..
And, big, big respect for using PHP, my favorite langulage! IDK why is now react/nextJS thet popular..
@ I think VS Code runs on Linux too. Regarding React or any other JS "framework" I don't care for any of them. Plain Vanilla JavaScript works just fine for me. I have my own libraries of polished functions that I combine as needed.
@@wc7 Of course vs code runs on linux, but adobe programs do not.
Thanks for the Video. What is requirement for learning Adobe Script Tutorial. I'm interest but I didn't any knowledge / experience any language or coding... I only know the InDesign very well.
The only prerequisite is understanding basic JavaScript. But note, Adobe script language is based on old JavaScript prior to 2009. So it helps to read old books rather than the latest materials (either books or online) that cover complex features that have been added to the language in recent releases that have no relevance to Adobe scripting. I recommend finding used books on the subject with publish dates prior to 2009. Usually you can get them for a reasonable price as well.
Great video.. is there a way to convert an adobe illustrator file to Javascript file? That would be nice if it exists
The two are completely different. One a description of artwork. The other instructions for a computer to execute. I can't image what the translation would be. JavaScript to draw artwork? I don't call things impossible, but is it practical, useful? And really worth the time it would take.
@William Campbell Yes. In my case it would be very useful. So how can I convert the ai file so it can become an ai file when executed?
@@maninzn The same AI file every time the script is executed? Serialize the AI file into a string value. Write the string value to a file within the script when executed. Beyond that (making decisions about how or what to draw) is beyond my interest, schedule, and likely ability.
I totally agree with you on the topics of declaring variables on top and prefixes ( Although I do 1 for visibility (l = local or g = global) and 1-2 letters for type, so something like lbOK.
I don't know JScript (I did something with it 20 years ago ... let's not count that) but I can watch other videos for it. I did expect that you show how to get the script that it appears under "Scripts" ... maybe it's a no-brainer if I'd have known more about JS... ^^
Never, mind, I'm off downloading the 2 programs and maybe it will be clear how the scripts appear...
I have other videos about installing scripts. Links should have been in the description. Links are there now. I'll add to the other tutorial descriptions as well. Here are the video links repeated...
Illustrator macOS: th-cam.com/video/DGMYAdv4N4k/w-d-xo.html
Illustrator Windows: th-cam.com/video/_RImYICaoFw/w-d-xo.html
InDesign macOS: th-cam.com/video/JdP1iXS9ZiY/w-d-xo.html
InDesign Windows: th-cam.com/video/gACWRCOxvSY/w-d-xo.html
Photoshop macOS: th-cam.com/video/b_kCiXFTNGk/w-d-xo.html
Photoshop Windows: th-cam.com/video/ZVYiXP7h6Rw/w-d-xo.html
More about installing scripts both macOS and Windows: www.marspremedia.com/software/how-to-adobe-cc
Other useful scripts for Adobe Creative Cloud applications: www.marspremedia.com/software
Thank you so much!!!?
how to crate auto frames createrscripts
I will need more details. Which application? (Illustrator, InDesign, or Photoshop?). Not sure what it means "auto frame". Please elaborate.
@@wc7 photoshop
@@langaliyamukesh962 OK but still not completely sure what you mean by "auto frames". I can guess maybe similar to other requests I've had for how to import images into a mask like I show in tutorial #8 (th-cam.com/video/og7kH_-CkzI/w-d-xo.html) except bring in multiple images into various sized masks. I am planning a tutorial video on how to do that. Should be soon.
Sir ur explain super. Sir i want Adobe Photoshop one any folder open first file only pls. Help me this script
See tutorial #5: th-cam.com/video/IMzRTPr19Bs/w-d-xo.html
Use that to open a folder. Only difference is process function. Instead for loop, use "files[0]". First element of file array is first file found. First element of array is index zero.
When you hoisted the variables at the end of the tutorial, you did it so quickly that I couldn't see what you were doing.
Click the gear for settings and set playback speed to 0.25 slows it all way down to see what I'm doing.
Ok
Can we make custom image buttons on an interface ?
It is possible. I haven't used images in my scripts only because I've never felt the need to. I like my interfaces simple, but that's just me. There is a great ScriptUI guide by Peter Kahrel every ExtendScript programmer should consult. The guide includes discussion of using images for UI buttons. Get the PDF here: creativepro.com/files/kahrel/indesign/scriptui.html
Is there a script listener for After Effects?
No. Scripting Listener is exclusive to x86 Photoshop.