🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
5 messages
5 total messages Started by Seth_McGraw Mon, 16 Feb 2009 15:13
Run a script from a script
#1247
Author: Seth_McGraw
Date: Mon, 16 Feb 2009 15:13
10 lines
1338 bytes
Can anyone help me run a script from a script to kill an event listener?
There is an event listener on save. The same script may be run multiple times before changing workflows (which require different sets of scripts).

The eventual goal is to have a time stamp in a specific text frame that will already have content. The new stamp will overwrite the old, and only happen before close. Right now it's set for "on save" because I can't figure out an if else statement for "before close". I don't want to have to end the session to be able to work different job types. I need to be able to kill the event listener when exiting documents that create one.

I'm throwing crap at the wall, hoping it will stick. I'm sure there's a better way to handle it. Anyone have ideas.

CS3 & CS4 javascript

Thanks
Re: Run a script from a script
#1117
Author: Seth_McGraw
Date: Tue, 17 Feb 2009 14:54
4 lines
736 bytes
Kill all the event listener stuff. It was figured out.

I do still however need to run a script from the end of another one.
Does anyone know how to do this?
Re: Run a script from a script
#1119
Author: Dave_Saunders
Date: Tue, 17 Feb 2009 15:04
13 lines
1026 bytes
Here's the kind of thing I use:

  function runShortRanges() { 
    var shortRangesScript = File(getScriptPath().parent.parent + "/IndexExtras/ShortRanges.jsx"); 
    if (shortRangesScript.exists) { 
      app.doScript(shortRangesScript); 
    } 
  } 


In this case, I want to run a particular script in a known location, only if it exists. It's a way of adding optional functionality to a script.

Dave
Re: Run a script from a script
#1118
Author: Dave_Saunders
Date: Tue, 17 Feb 2009 15:04
13 lines
866 bytes
Ah, you'll need the getScriptPath function:

function getScriptPath() { 
  // This function returns the path to the active script, even when running ESTK 
  try {  
    return app.activeScript;  
  } catch(e) {  
    return File(e.fileName);  
  } 
} 


Dave
Re: Run a script from a script
#1120
Author: Seth_McGraw
Date: Tue, 17 Feb 2009 16:34
1 lines
701 bytes
Awesome, I'll check it out today. Thanks
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