Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Action in startup script needs to wait for IDCS3 plugins to fully load

Guest
Apr 07, 2008 Apr 07, 2008
Hi all, if anyone has any advice for this, I'd be much obliged:

I'm working with K4 and Made to Print in IDCS3 on a mac.

I've got a javascript that automatically logs into K4 with a specific username. It needs to run right after InDesign launches. If I put it into the startup scripts folder, I get an error when it executes because K4 and/or Made to Print have not finished loading up on startup.

The script works fine if I run it manually after K4 and Made to Print are loaded.

I tried adding a delay to the beginning of the script, but that seems to simply halt all processing in InDesign instead of allowing the plugins to load and finish their startup processes.

I tried moving the login script out of startup scripts, and instead put a pointer script into the ID startup script folder, to get the delay to happen outside of InDesign. That didn't seem to make a difference InDesign still halted till the delay was over.

If you couldn't tell I don't spend much time scripting, so looking for advice!

Thanks!
TOPICS
Scripting
947
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 08, 2008 Apr 08, 2008
Nice to see that someone else is using K4 scripting.
The easiest solution is to start InDesign by Applescript.

tell application "Adobe InDesign CS3"
activate
try
k4 log in k4 user name "rf" k4 password "mysecretpassword"
end try
end tell

If you want to log in automatically after InDesign is started (the usual way) you need to define an eventlistener. As far as I can tell there is no event afterStart. But you can define a beforeNew or a beforeOpen event. Like this:

#targetengine "session"
main();
function main(){
var myEventListener = app.addEventListener("beforeNew", K4Login, false);
}
function K4Login()
{
app.k4LogIn("rf","mysecretpassword");
}

This way ID would try to log in before creating a new document. (It works. I have tested it.)
Of course you would need to create a dummy document... You could also try a menu action...

Ralf Funke
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 10, 2017 Jun 10, 2017
LATEST

Great!!!

-Sumit
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 30, 2008 Jul 30, 2008
Hi

I am able to check in and check out the existing files in K4 using java scripting. Wat i am trying to do is to check in new files into K4 as layouts. The command that i use is

app.documents[0].K4InitDatabaseData( K4ObjectType.K4_LAYOUT_OBJECT, "137102182");

where the number 137102182 is the id of the publication.

This command is not working. Am i doing something wrong or do I need to add any more commands to check in my active document into K4 as layout.

Thanks
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines