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

afterOpen listener

New Here ,
May 30, 2008 May 30, 2008
I am trying to set up a listener for InDesign, so that every time a doc is opened, "Overprint Preview" is turned on. I have the following script saved in the InDesign Startup Scripts folder:
//*******************************************
#targetengine 'session'
main()
function main()
{
var myApplicationEventListener = app.addEventListener('afterOpen', myafterOpenHandler, false)
}
function myafterOpenHandler(myEvent)
{
//turn Overprint Preview on
var myMenuAction = app.menuActions.item("$ID/Overprint Preview")
myMenuAction.invoke()
}
//*******************************************
The menu invoke works by itself just fine, if a doc is open.
But the script itself errors, just before the doc opens, presumably because the menu is not available yet, since the doc is not showing. The error is as follows:

JavaScript Error!

Error Number: 53762
Error String: Action is not enabled.
Line: 27
Source: myMenuAction.invoke()

Any ideas on this?????
TOPICS
Scripting
423
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
Community Expert ,
Oct 05, 2008 Oct 05, 2008
LATEST
Rick, have You ever been able to fix that problem?
If so I would be interested in Your solution.
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