Article View: adobe.scripting.indesign
Article #15131JS: Activate method
From: Dave_Saunders
Date: Wed, 31 Dec 2003 16:45
Date: Wed, 31 Dec 2003 16:45
23 lines
1399 bytes
1399 bytes
Am I misunderstanding the use of the activate method in this snippet? Or does this script demonstrate a problem:
myStart = (new Date()).getSeconds();
while (true) {
if (app.visible) {
myCurTime = (new Date()).getSeconds();
myPeriod = myCurTime - myStart;
(myPeriod < 0) ? myPeriod = myPeriod + 60 : myPeriod;
if (myPeriod > 10) {
alert ('You have failed to hide the application in ten seconds');
exit();
}
} else {
app.activate();
alert ('Application was invisible');
exit ();
}
}
I get a run time error when the app.application() command is reached (happens if you Command-Option-Click on the Finder after launching the script). This under Mac OS X 10.3.2.
Dave
Technical Details
Message-ID:
<2ccf2490.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,41bf11fa4528dee9,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-12-31 09:07:59 PST From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: JS: Activate method Message-ID: <2ccf2490.-1@webx.la2eafNXanI> Date: Wed, 31 Dec 2003 08:45:41 -0800 Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit