🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15309

Re: Any advantage in learning JavaScript over AppleScript?

#15309
From: Dave_Saunders
Date: Mon, 08 Dec 2003 05:03
11 lines
1930 bytes
I entertained myself today writing a new tutorial. This one centers around a simple script I wrote to insert the date into a document. I discovered this morning that the inserted date always uses a two-figure number of the date, resulting in Sunday, December 07 2003 for today. So I decided to fix that.

First, I show how to fix it in JavaScript, then I show how to do it by manipulating the text after it's placed using Find/Change.

But then I decided that perhaps a user might want to have a dynamic date -- well, you can't quite do that with a script because you need to be able to have event-driven scripts to be fully dynamic. But what if you just wanted to write another script to update the dates in a document on demand -- how would that script find the dates? The answer is a character style.

But that raises issues of whether or not the user actually wants to do this. So I created a dialog to let the user choose, and I show how to tag a document so that the dialog would not be repeated if the user doesn't want to be bothered each time he runs the script. And then it occurred to me that a user might want to just make the decision once and for all for all his documents; that requires a preferences file.

So, my 2-line script became 100+ lines.

Dave
Technical Details
Message-ID: <2cce710b.9@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2cce710b.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,76379a2d4cf65ca4
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-07 21:07:39 PST
From: Dave_Saunders@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: Any advantage in learning JavaScript over AppleScript?
Message-ID: <2cce710b.9@webx.la2eafNXanI>
Date: Sun, 7 Dec 2003 21:03:44 -0800
References: <2cce710b.-1@webx.la2eafNXanI>
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit