-
1. Re: [JS] [CS4] afterOpen event query
Kasyan Servetsky Sep 29, 2010 10:47 AM (in response to Skempy)Try
var myDoc = app.documents[0];
instead of
myDoc = myEvent.parent
(I haven't tested it)
Kasyan
-
2. Re: [JS] [CS4] afterOpen event query
Harbs. Sep 30, 2010 3:36 PM (in response to Skempy)It's probably not possible.
You can't do UI specific stuff without a window open...
It might be possible using AppleScript or VB, but I doubt it...
If you are using CS5, you can try to add an idle event listener on docOpen, and do your work in that event. If you can get this to work, don't forget to remove the idle event handler afterwards!!!
Harbs
-
3. Re: [JS] [CS4] afterOpen event query
Skempy Oct 1, 2010 5:06 AM (in response to Harbs.)Kasyan, Harbs,
Thank you both for you replies. Unfortunately no CS5 yet.
Simon.
-
4. Re: [JS] [CS4] afterOpen event query
Kasyan Servetsky Oct 5, 2010 2:31 AM (in response to Skempy)This can be easily achieved with APID Toolkit:
if (theItem.eventCode == "docLoaded") {
try {
var gDoc = app.activeDocument;
gDoc.pageItems.item("copy").select();
app.copy();
}
catch(err) {}
}Event Filter: docLoaded
I wonder why the following code works then:
#target indesign
#targetengine "MyEngine"
var myEventListener = app.eventListeners.add("afterOpen", myDocOpen, false);
function myDocOpen(myEvent)
{
var myDoc = app.documents[0];
var myLink = myDoc.links[0];
var myFile = new File("/C/Test.pdf");
if (myFile.exists) {
myLink.relink(myFile);
}
}You can also add pages using afterOpen event -- but select and copy doesn't work

Kasyan
-
5. Re: [JS] [CS4] afterOpen event query
Skempy Oct 5, 2010 3:14 AM (in response to Kasyan Servetsky)Thanks Kasyan,
I am going to have a look at Rorohiko's APID Developer Toolkit but I would need to deploy the ToolAssistant on about 60 workstations and currently have no budget.
If I can develop a working solution using this though, a budget might become available.
Thanks.
-
6. Re: [JS] [CS4] afterOpen event query
Kasyan Servetsky Oct 5, 2010 5:54 AM (in response to Skempy)but I would need to deploy the ToolAssistant on about 60 workstations and currently have no budget.
To develop scripted plug-ins you need APID Toolkit — $149, to use such plug-ins you need only APID ToolAssistant — $25 per seat, if you buy in bundle it's even cheaper: 10 — $19.90, 100 — $15.99, 1000 — $8.10.
Anyway you can download both demo versions and test them for 20 days and decide if you need them or not.
Kasyan


