Skip navigation
Currently Being Moderated

InDesign ExtendScript...is this worth learning?

Sep 14, 2010 5:59 AM

Hello,

I have been trying to learn AppleScripting so that I might automate more of my of my InDesign stuff. When searching for more books, I came across a book by Shirley W.Hopkins called automating Adobe InDesign CS4 with ExtendScript. Does this scripting option seem to be a good one to learn, even over AppleScripting? It seems like a valuable option if I want to focus on InDesign, but I would like to hear from others if they are using it and is it worth the learning curve?

thanks!!

babs

 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Sep 14, 2010 6:07 AM   in reply to iBabs2

    Hey!

     

    I suggest you to learn JavaScript. It's cross platform. As is Mac only, and VB Script is PC only.

    So by learning JavaScript you get all, on both platforms

    Nice book to begin with is: http://oreilly.com/catalog/9780596559601/

    Also there a lot of sites, tutorials, examples how to script InDesign with JavaScript.

     

    Hope it helps!

     

    --

    tomaxxi

    http://indisnip.wordpress.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 6:13 AM   in reply to iBabs2

    There was a nice discussion some time back on InDesign Secrets about AppleScript vs. ExtendScript:

    http://indesignsecrets.com/applescript-why-indesign-users-should-learn -it.php

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 6:46 AM   in reply to iBabs2

    Probably the strongest arguement for ExtendScript is this forum.

     

    The ExtendScripters far outnumber the AppleScripters, so you would probably get much better help wit ExtendScript...

     

    Good luck!

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 7:00 AM   in reply to Harbs.

    If you have the time then learn and use both…

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 7:07 AM   in reply to Muppet Mark-QAl63s

    True.

     

    As well as ActionScript, Visual Basic, C++, php, Objective C, Java, Perl, Ruby, etc...

     

    ActionScript was this past winter. Right now, I'm concentrating on C++. What'll be next? Who knows. Probably php or Java...

     

    I played around with some JQuery yesterday for the first time. Nice stuff!

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 7:19 AM   in reply to iBabs2

    iBabs2 wrote:

     

    Yes, that JQuery does seem cool, but I thought it was only for web design, not InDesign?


    Unless of course you are connecting InDesign to a website...

     

    Once you start down that programming road, there aint no turning back...

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 7:36 AM   in reply to iBabs2

    Just name something you would like to automate -- a simple thing, so we can explain it line by line (if necessary )

     

    Do you have any programming experience at all? For Javascript this is kind-of a must, for AppleScript it's much less -- but InDesign's interface with AS is a bit befuddling, even for AS experts ...

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 9:22 AM   in reply to iBabs2

    I started scripting InDesign with no previous programming experience at all. I found Javascript very easy to learn. The language is very logical, and there's very little syntax that you need to get started.

     

    If you know

    1. a for loop, (for(i=0;i<length;i++){})
    2. a while loop (while(x){})
    3. if, else, and else if
    4. try, catch, finally
    5. proper use of "", [], and {} (strings, arrays, and objects)
    6. arithmatic operators (+,-,*,/)
    7. logical operators (||, &&)
    8. comparison operators (==, !=, >, <, >=, <=)
    9. how to create and use a function,

     

    you're more or less ready to go!

     

    Of course there's more to the language, but you can more or less get by with the above...

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 11:18 AM   in reply to iBabs2

    Don't forget its zero based… That can throw you for a little while if your used to AppleScript particularly in them loops…

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 11:43 AM   in reply to iBabs2

    For what it's worth, I started scripting about two or three years ago, at the age of 50, with next-to-nothing of prior experience, and I'm still nothing like a hotshot because I do lots of different types of thing in life, but scripting is definitely a very, very worthwhile thing to learn. I started off with Adobe's free scripting tutorial PDF, trying a bit of Applescript, and wrote a couple of modest but still extremely useful things that saved me hours of work.

     

    Note: even a tiny bit of modest scripting can save hours of tedious repetitive work!

     

    After those early Applescripts, Javascript began to make sense to me. So I switched. One half of my brain wishes I had known about Peter Kahrel's brilliant introductory book at the time, but the other half doesn't, because I learned an incredible amount by simply producing errors about 95% of the time. It was painful, but salutary.

     

    Note: now I'm only producing errors about half the time!

     

    If you want to start off with a book, I strongly recommend Peter's. But I also think trial and error is utterly invaluable. It's really quite exciting and enjoyable to be trying one more-or-less obvious thing after another, wondering what the hell am I doing wrong, when suddenly you get a new idea and -- sure enough -- that was the problem! (Of course, quite often the ideas are supplied by the members of this hugely talented forum.)

     

    If you want to use a book, I'd go for a smallish book. The idea is to start to swim on your own, then develop your swimming skills, minus the flotation devices.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2010 4:18 PM   in reply to iBabs2

    That's right. Everything starts with 0 in Javascript -- not 1.

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 3:50 AM   in reply to Harbs.

    Dear Harbs

     

    "I played around with some JQuery yesterday for the first time. Nice stuff! " - Harbs

     

    Really very nice and I excited, Happy  regarding you are using the "JQuery" operations.

     

    Harbs, Can we use Java in InDesign CS4 [Desktop].? Please let me know your comments...

     

    and the same PHP uasge in InDesign application. I need your personal comments.

     

    I tried some "JIntegra Tool" using to JAVA  EXE converted Objects Classes /Methods. That Object classes used to connect the InDesign application, But Its failed. I used flexibility and fastly in InDesign Server Only. Because you know Indesign Server only run with JAVA.

     

    Please I need your comments & suggestion regarding these applicaitons [JAVA / PHP - in InDesign]

     

    Thanks & Regards

    T.R.Harihara SudhaN

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 4:18 AM   in reply to Harihara Sudhan

    No. I did not mean that you can (or would want to) use any of that to control InDesign.

     

    Please don't take what I said out of context. I was a reply to Mark that there's a lot of languages which pay to learn. I meant that these can all be useful in other areas when building a solution where InDesign might be involved...

     

    Of course you can use Java to control ID Server, but it's not necessary there either...

     

    Harbs

    http://www.in-tools.com

    Innovations in Automation

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 9:37 AM   in reply to Harbs.

    I agree with many of the comments here. I think JavaScript (Extendscript) will pay much greater dividends in terms of future applications, and it's reasonably easy to learn. Once you have the basics of JavaScript you only have to learn specific API commands for different enviroments (HTML, Illustrator, Photoshop, etc).

     

    Also, once you've learned JavaScript, Applescript will likely seem needlessly verbose.

     

    Best of luck!

     

    Justin Putney

    Ajar Productions

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 10:14 AM   in reply to Justin Putney

    Hey Justin,

     

    Have you tried my Script Bay?

     

    I'd be interested in hearing what a Flash guy thinks of it...

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 10:43 AM   in reply to Harbs.

    I haven't tried it yet, Harbs. Looks like a neat idea...

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 11:18 AM   in reply to iBabs2

    I forgot to mention a very helpful resource if you want to just get stuck in and get going: Olav Kvern's scripts for the Adobe InDesign Scripting Guide available free here (you have to open the concertina menu by clicking on the "Scripting resources" tab, the third horizontal gray bar from the top, then press the "Download the InDesign sample scripts" button).

     

    Sometimes you might wonder something like "How would I get a script to open an umbrella?", or whatever, and quite often there's an example script in that collection that shows you a simple version of just that.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 11:28 AM   in reply to Jeremy bowmangraphics

    Yeah, there are lot's of great places with script examples and how to use scripting to automate InDesign.

    Marc Autret did a great job and collected them on one place!

    Take a look here: http://bit.ly/cHiLFo

     

    --

    tomaxxi

    http://indisnip.wordpress.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 11:50 AM   in reply to iBabs2

    Everything has its pros and cons, but I don't like javascript because it's too symbolic ("=" vs "=="; "+=" vs "=+", etc.) and too terse, it's much harder to program using the "monkey see, monkey do" methodology, you can't simply and easily control several apps at the same time, and I view it as a Mac-hostile environment. But I'm not a computer scientist, a techie, or a real programmer who hops in and out of various languages. I prefer to speak English to my computer as much as possible. That's just me. As a generalist, I highly favor easy natural language programming over theoretically faster and more efficient programming. (Eventually, I think the majority of us will be able to instruct our computers to help us via spoken language, and I do not foresee any symbolic language being used for that purpose.)

     

    This is the right place for help with javascript, though -- and you'll need it.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 12:34 PM   in reply to L. Guy O\'Rojo
    ..  it's much harder to program using the "monkey see, monkey do" methodology ..

     

    This is one thing that InDesign (and friends) is missing: a Record option such as in Word, where you can either record-and-playback any action, or open the file and tinker with what it's doing.

     

    .. you can't simply and easily control several apps at the same time ..

     

    Now that is AppleScript's strongest point! Nothing under Windows comes close -- perhaps the bash shell under Linux does (that's not for the easily spooked either).

     

    .. and I view it as a Mac-hostile environment. ..

     

    You should see XCode. Or the InDesign SDK ...

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 1:24 PM   in reply to iBabs2

    My Opinion.

     

    There is another great advantage to using JS as opposed to AS.  The web is FULL of web developers, most of which know how to use Javascript.  Sure, with a different output, but the basic JS functions (substring, split,join etc) are all used in both environments. 

    I sometimes find myself (and I am putting myself in the still very much learning category here) going to http://www.w3schools.com for this sort of prompting when I forget how to use a function.

     

    That said, I have to second what has been said about this forum.  I have been using it for maybe 8 years now, and have found everyone on here helpful, and have ended up at events where I have met key contributors (minor celebrities in my opinion).

     

    I started in AS, and was very happy in it, but I needed for one of my scripts to be run on a PC.  So I switched. I have never looked back. 

     

    When you are using JS, you still can call AS scripts using doScript which I do occasionally, so any AS work is not necessarily lost for you.

     

    It is sad for me being a BIG mac fan, but if you are using JS then I have found at times the same script can run on a PC a great deal faster than on a Mac.  That was going back a few years, with CS2, on a PPC platform, so cannot say if the same is true now, but just an observation.

     

    The most important thing is you enjoy what you are doing. I do it as part of my job, but love any free time I am allowed to play, and try new stuff with Javascript.

     

    Have Fun!

     

    Roy

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 1:39 PM   in reply to Roy Marshall

    It seems like someone could simply write a JavaScript API/interpreter that interfaced with AppleScript. Then JavaScript would work on a Mac for other apps, too. One could also extend that API to Windows in general to control those apps as well.

     

    If Apple were as committed to open standards as they claim, we'd already have JS that could automate a Mac. JS is part of the HTML5 that Steve Jobs has touted as a Flash killer, so why not implement a JS-Applescript layer in the Mac OS (or better yet, native JS)?

     

    My opinion as someone who codes quite a bit, is that terseness is a preferred quality in a computer language. Programming and scripting languages are designed to save time and operate logically (which plain english doesn't always do so well). That's my 2 cents.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 2:51 PM   in reply to Jeremy bowmangraphics

    That last link didn't work, sorry. Try here:

     

    http://www.adobe.com/products/indesign/scripting/

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 3:01 PM   in reply to L. Guy O\'Rojo

    L. Guy O'Rojo wrote:

     

    Everything has its pros and cons, but I don't like javascript because it's too symbolic ("=" vs "==";

    The way I see it, that's a vital logical difference that any scripting language must respect. A command is not a description.

     

    (On a philosophical level, Hume insisted that an "ought" and an "is" are completely different, and this is it in code!)

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 5:44 PM   in reply to Justin Putney

    It seems like someone could simply write a JavaScript API/interpreter that interfaced with AppleScript. Then JavaScript would work on a Mac for other apps, too. 

     

    Someone did, several years ago; it was in Script Debugger. It's since been abandoned due to overwhelming lack of interest.

     

    If Apple were as committed to open standards as they claim, we'd already have JS that could automate a Mac.

    The only claimed commitment was to "open Web standards", which has nothing to do with IAC languages like AppleScript. And if they did implement js scripting at a system level, it would of necessity be different to Adobe's custom implementation (running outside an app's environment raises a whole lot of other issues). So people would have a choice of two flavors of js, instead of js and something else -- that seems like a retrograde step to me (and would make life around here really interesting).

     

    My opinion as someone who codes quite a bit, is that terseness is a preferred quality in a computer language.

    And many people who code quite a bit would probably agree with you. (Whether that's because that's how they learned to code is another question.) But the point of using a natural-language like interface for AppleScript was to make it accessible to those who don't necessarily "code quite a bit". One size doesn't suit all.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 8:50 PM   in reply to Shane Stanley

    sstanleyau wrote:

     

    It seems like someone could simply write a JavaScript API/interpreter that interfaced with AppleScript. Then JavaScript would work on a Mac for other apps, too. 

     

    Someone did, several years ago; it was in Script Debugger. It's since been abandoned due to overwhelming lack of interest.

     

    Cool. I'll look it up. Thanks.

    If Apple were as committed to open standards as they claim, we'd already have JS that could automate a Mac.

    The only claimed commitment was to "open Web standards", which has nothing to do with IAC languages like AppleScript. And if they did implement js scripting at a system level, it would of necessity be different to Adobe's custom implementation (running outside an app's environment raises a whole lot of other issues). So people would have a choice of two flavors of js, instead of js and something else -- that seems like a retrograde step to me (and would make life around here really interesting).

     

    I was being partially facetious on this point. Just poking a little fun at the Apple worship (I'm a Mac user as well, but for lack of a better alternative).

    My opinion as someone who codes quite a bit, is that terseness is a preferred quality in a computer language.

    And many people who code quite a bit would probably agree with you. (Whether that's because that's how they learned to code is another question.) But the point of using a natural-language like interface for AppleScript was to make it accessible to those who don't necessarily "code quite a bit". One size doesn't suit all.

    Actually, I was a designer before I was a developer (and I still am a designer). I work almost entirely with designers (and not other developers). So I have a reasonably balanced perspective on this. The idea of a "natural-language" is a bit bogus. Especially because programming is about logic, so "natural" should reflect an ease of writing logical statements. You still have to learn an entirely arbitrary language with Applescript (especially arbitrary in English, which is loaded with synonyms, so you can't guess keywords), it's just more verbose. And it still has to write logical statements. Something that is truly oriented to a non-coder, omits code entirely (e.g., Automator).

     

    I'm not suggesting one-size fits all, I'm all for different languages for different purposes...if I can state it a bit hyberbolically...just that a tissue box does not make a great shoe, though it may cover your foot.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 11:37 PM   in reply to Justin Putney
    Actually, I was a designer before I was a developer (and I still am a designer). I work almost entirely with designers (and not other developers). So I have a reasonably balanced perspective on this.

    I'm not a programmer by background either, even if I spend too much time these days in Objective-C and C. And I'd be the first to admit that the natural-language thing can be overstated, and is not without its own problems. But people have been writing serious automation stuff in AppleScript and VB for many years; it's not like js is solving any great problem other than cross-platform ability, at the often more significant cost of cross-application scripting. More people use multiple applications than use multiple platforms. For those already familiar with it, js is a logical choice. For others, choosing a tool that suits their projects can make more sense. And if those projects involve a multitude of apps, js is problematic.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2010 1:12 AM   in reply to Shane Stanley

    Im with Shane on this one… Coming form the design background for many a year and no programing experience. I was introduced to scripting some 4-5 years back. At that time I had to think over my options of what I needed and which language best suited the jobs in hand. At that time AppleScript won the contest by some distance, it made the writing of syntax so much easier to understand and the ease in which you could communicate between apps was astounding. Over the past 12-18 months I have been trying to learn this ExtendScript and its the programming logic that I've picked up from using the user friendly AppleScript that I has helped me understand a little more of ExtendScript this time around. My need to communicate between apps far out weighs any cross platform issues and when I need to do so I still go back to AppleScript. The tool-kit leaves a bit to be desired but I am only working with CS2.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2010 8:47 PM   in reply to Muppet Mark-QAl63s

    Muppet Mark wrote:

     

    The tool-kit leaves a bit to be desired but I am only working with CS2.

    I agree. The ExtendScript toolkit, while functional, leaves a lot to be desired.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 18, 2010 8:39 AM   in reply to Justin Putney

    Babs, if you are to stick with the AppleScript meantime then do take a good look at the Script Debugger that was mentioned (if you don't already have this?). I have had this on trial a couple of times and it looks great. Its NOT cheap but I've only heard praise from those that can stretch to this… its been on my wish list for quite some time. Viewing in that explorer mode is jawdroppinglycool (did I just make that up?)… and it makes the object model a lot easier to understand…

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 18, 2010 9:33 PM   in reply to iBabs2

    Script Debugger is alive and well, and as indispensable as ever!

     

    It's just that it's dropped support for javascript.

     
    |
    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points