Thread View: adobe.scripting.indesign
13 messages
13 total messages
Started by Malcolm_Whild
Wed, 11 Mar 2009 02:22
Applescript or Javascript?
Author: Malcolm_Whild
Date: Wed, 11 Mar 2009 02:22
Date: Wed, 11 Mar 2009 02:22
9 lines
1255 bytes
1255 bytes
Hi, I'm on a Mac and have been using Applescript quite successfully to automate many common tasks, especially tables. The only thing I'm concerned about is whether I'd be more sensible to learn Javascript and use that instead. It seems that Javascript is much more like a 'real' programming language and I wondered if it has any other advantages (is it faster for example than Applescript). There might come a time when I'll be working on PCs rather than Macs and then I wouldn't be able to use Applescript at all (or would I?). Any thoughts or preferences from you scripting experts out there? Thanks, Malcolm
Re: Applescript or Javascript?
Author: jongware
Date: Wed, 11 Mar 2009 10:12
Date: Wed, 11 Mar 2009 10:12
10 lines
976 bytes
976 bytes
.. I wouldn't be able to use Applescript at all
Precisely.
JavaScript is the only language that works on both platforms -- Mac native is AppleScript (and I'm pretty sure it is a 'real' programming language), Win native is VBScript (now there's some doubts :-) ). If you ever, EVER consider a platform transfer, or -- as I do -- work in a multi-platform office, use JS exclusively.
Re: Applescript or Javascript?
Author: Shane_Stanley
Date: Wed, 11 Mar 2009 10:56
Date: Wed, 11 Mar 2009 10:56
26 lines
2506 bytes
2506 bytes
On 11/3/09 9:12 PM, "jongware" <member@adobeforums.com> wrote: > If you ever, EVER consider a platform transfer, or -- as I do -- work in a > multi-platform office, use JS exclusively. On the other hand, if you ever plan to build workflows that involve more than one app, and especially using non-Adobe apps (think spreadsheets, databases, mail apps, command line, etc), you need to use AppleScript or VB rather than Adobe's proprietary js engine. JS has a lot going for it: cross-platform, more built-in stuff like grep, persistent engines, plus access to stuff like ScriptUI. But it also has disadvantages -- you don't have droplets (my favorite UI because of its speed and simplicity) like AppleScript, ESTK is, IMO, fragile and ugly, and not a patch on a professional IDE like Script Debugger, and it has scope issues. To me, cross-app is more important than cross-platform -- I generally only use one platform, but I use and automate lots of apps. Others have different priorities. Be thankful for the choice, and if you have the time, learn 'em all. The hardest part of scripting InDesign is understanding the object model, and that's much the same whatever the scripting language. -- Shane Stanley <sstanley@myriad-com.com.au> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Re: Applescript or Javascript?
Author: SuperMacGuy
Date: Wed, 11 Mar 2009 13:01
Date: Wed, 11 Mar 2009 13:01
2 lines
1431 bytes
1431 bytes
I've been scripting for 10 years, all on Macs. Scripts that started as simple single-use things eventually turned into full blown apps. I use XCode to build applescript based application that can drive InDesign as well as interface with Filemaker Pro, Interarchy (FTP), a full blown user interface, Distiller, shell commands, and the Finder. I know none of this stuff will never work on a PC, but integration across multiple apps is far more beneficial to me than having a "portable" javascript. I just figure I'll never need to use Windoze, I can do so much more with my Mac (plus my office is committed to Macs). You could make a similar argument for development on a PC, especially if you started there. I just found it was so much easier to build full apps with xCode + Applescript than starting from 0 with another programming language or platform.
Re: Applescript or Javascript?
Author: Ralf_Funke
Date: Thu, 12 Mar 2009 09:26
Date: Thu, 12 Mar 2009 09:26
5 lines
1206 bytes
1206 bytes
Learn JavaScript but do not forget AppleScript. I have quite a lot of projects where I use both. AppleScript mainly to trigger JavaScript (with doScript) and to talk to non-Adobe Apps. (And I also use RealBasic when I need a user interface that is a bit more complex than JS or AS allow me to build.) I personally was very sceptical about JavaScript but once you get used to it has some advantages over AS (mainly that there is no deceptive "simplicity".) Shane is right though with his remarks on ESTK. It is more fun working with AS. Ralf
Re: Applescript or Javascript?
Author: Eric
Date: Thu, 12 Mar 2009 18:01
Date: Thu, 12 Mar 2009 18:01
15 lines
1517 bytes
1517 bytes
I tend to stick with Applescript simply because I always find the syntax of Javascript pretty daunting by comparison. It can make revisiting a script you haven't had to edit in a year or two somewhat easier. (Provided you name your variables and comment well, of course.) e.g. it is pretty simple to just read what is going on in stuff like this: set pStylesList to every paragraph style whose name does not contain "[" repeat with thisStyle in pStylesList --Append "-old" to all current para styles except default set name of thisStyle to name of thisStyle & "-old" end repeat Which is certainly not to say there's not more power locked in Javascript. There are a lot of rudimentary things, such as sorting that aren't part of the basic AS syntax, alas... And a way to set a variable quicker would be nice! x := 0 like Pascal has, for "power" users or something.
Re: Applescript or Javascript?
Author: Malcolm_Whild
Date: Thu, 12 Mar 2009 20:46
Date: Thu, 12 Mar 2009 20:46
13 lines
2412 bytes
2412 bytes
Thank you all for your helpful comments. Jongware � I take your point about working in a multi-platform office. I've been self-employed for the last 10 years while my daughter was at school (I wanted to be at home for her when she came home), but now she's off to Uni and I'm keen to get back into the workplace again. Many people think that's crazy, but I miss the opportunity to bounce ideas around with other techies and also the chance to get my hands on the latest hardware and software (I'm still using CS2 on a G5 under Tiger if you can believe that). The trouble is, I've been working Macs exclusively (and I love 'em) during that time and I know that it narrows considerably my options when it comes to job hunting. Publishing is a small industry in my little corner of the World and the few opportunities that appear are quickly snapped up by more multi-talented, less wrinkled people. Hence the need to upskill and maybe break out of publishing altogether. On the other hand, Shane and Supermacguy make good points about multi-app scripting. I am also a big fan of Xcode, although I've only used it in a very limited way so far (not much time for R&D when your working day ends 5 minutes before bedtime). Is there not a similar environment for Windows? Or does all the hard work need to be done manually? Shane, when you say that the hardest part is learning the object model, do you mean how to address correctly the part of the document that you want to work on? If so, then I agree completely � I've torn my hair out on many an occasion while trying to automate a simple task that takes two or three minutes to do manually! The main theme here seems to be 'learn everything', which I suppose I should have expected! I'm off now to trawl the net for an Indesign/Javascript tutorial. Thanks again, Malcolm
Re: Applescript or Javascript?
Author: Shane_Stanley
Date: Thu, 12 Mar 2009 22:01
Date: Thu, 12 Mar 2009 22:01
12 lines
1646 bytes
1646 bytes
On 13/3/09 7:46 AM, "Malcolm Whild" <member@adobeforums.com> wrote: > Shane, when you say that the hardest part is learning the object model, do you > mean how to address correctly the part of the document that you want to work > on? Right -- knowing the language syntax and commands is a relatively easy exercise, comparatively. -- Shane Stanley <sstanley@myriad-com.com.au> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Re: Applescript or Javascript?
Author: Malcolm_Whild
Date: Thu, 12 Mar 2009 22:16
Date: Thu, 12 Mar 2009 22:16
7 lines
855 bytes
855 bytes
Yes � it's a pity that the Indesign scripting documentation provided by Adobe is pretty complex, and yet strangely vague at the same time. I'd like to see more real-world examples, fully worked through, with comments. Perhaps I should write some � Malcolm
Re: Applescript or Javascript?
Author: Eric
Date: Thu, 12 Mar 2009 23:48
Date: Thu, 12 Mar 2009 23:48
3 lines
1029 bytes
1029 bytes
This is one of the things that makes it easier to learn AS, imho. cmd-shift-L brings up a list of libraries, you open the InDesign CS2 reference and then use the search field to hunt up the keyword most likely to match what you're looking for. ESTK has something similar under the Help menu, but it is pretty kludgy by comparison. If you're interviewing for jobs, knowing JS is definitely a more salable skill though, because a LOT of programs use JS.
Re: Applescript or Javascript?
Author: Malcolm_Whild
Date: Thu, 12 Mar 2009 23:58
Date: Thu, 12 Mar 2009 23:58
2 lines
4321 bytes
4321 bytes
Yes � and the libraries are much improved since Tiger as well. You're also right about the English-sounding syntax making it easier to revisit old scripts.<div><br></div><div>Thanks,</div><div><br></div><div>Malcolm</div><div><br><div> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">--<span class="Apple-converted-space">�</span></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">BookNZ � Professional book design and production</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Visit us on the Web at <a href="http://www.booknz.co.nz">http://www.booknz.co.nz</a></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">29 Flavia Close</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Torbay, Auckland</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">New Zealand</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Telephone +64 9 473 8830</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Fax<span class="Apple-converted-space">� � � � � � � </span>+64 9 473 0068</font></p> <br class="Apple-interchange-newline"> </div><br><div><div>On 13/03/2009, at 12:48 PM, Eric @ MCA wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">A new message was posted by Eric @ MCA in <br><br> <b>InDesign Scripting</b> --<br> ��Applescript or Javascript?<br><br> This is one of the things that makes it easier to learn AS, imho. cmd-shift-L brings up a list of libraries, you open the InDesign CS2 reference and then use the search field to hunt up the keyword most likely to match what you're looking for. ESTK has something similar under the Help menu, but it is pretty kludgy by comparison. <br><br>If you're interviewing for jobs, knowing JS is definitely a more salable skill though, because a LOT of programs use JS. <br><br> <hr width="200" align="left">View/reply at <a href="http://www.adobeforums.com/webx?13@@.59b82d8a/8">Applescript or Javascript?</a><br> Replies by email are OK.<br> Use the <a href="http://www.adobeforums.com/webx?280@@.59b82d8a!folder=.eea52bc">unsubscribe</a> form to cancel your email subscription.<br><br></blockquote></div><br></div>
Re: Applescript or Javascript?
Author: Harbs
Date: Fri, 13 Mar 2009 11:41
Date: Fri, 13 Mar 2009 11:41
6 lines
852 bytes
852 bytes
Peter's book is a great place to start with javascript in InDesign. http://oreilly.com/catalog/9780596528171/ -- Harbs http://www.in-tools.com
Re: Applescript or Javascript?
Author: Peter Kahrel
Date: Fri, 13 Mar 2009 14:09
Date: Fri, 13 Mar 2009 14:09
4 lines
656 bytes
656 bytes
Thanks, Harbs. CS3/4 update about to roll of the presses. Peter
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads