Welcome, Guest. Please Login
Rorohiko Workflow Resources
  Welcome the Message Board of Rorohiko Workflow Resources. To register, please e-mail [email protected] - automatic registration has been turned off because of relentless spambots and spammers. This Message Board is not actively monitored. If you have an urgent question, please e-mail [email protected]. If you post it here, it will probably be many weeks before we notice.
  HomeHelpSearchLogin  
 
Page Index Toggle Pages: 1
Send Topic Print
Beware of functions called 'resolve' (Read 3458 times)
Kris Coppieters
YaBB Administrator
*****
Offline



Posts: 181
New Zealand
Gender: male
Beware of functions called 'resolve'
08/13/06 at 08:16:06
 
Recently, we encountered a fatal conflict between Active Page Items Runtime and an InDesign script (it's a handy script by Dave Saunders, who has a lot of cool donationware scripts

http://pdsassoc.com/

He also has a very interesting blog at

http://jsid.blogspot.com/

Check it out!).

Diagnosing the issue took me most of a day - I was ready to loose faith in computers. Eventually, I figured it out.

The morale: when developing in ExtendScript, avoid naming any of your functions 'resolve'.

There is a built-in function by the same name.

If you define a function called 'resolve' in a script, it will override the built-in 'resolve' function, and that can cause all kinds of havoc when something (like APIR or APID) attempts to call the built-in 'resolve' function.

For example, our runtime plug-in needs the built-in 'resolve' function to gain access to some scripting features.

But if a script overrides it with a different version of 'resolve' things go very wrong...

Instead of calling the built-in version, the other version will be called instead, and that causes all kinds of bad behavior.

Dave has updated his script to not use the name 'resolve' any more (thanks, Dave!)...

Back to top
 

Kris
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print