Message Board for Rorohiko Workflow Resources
https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl
General Category >> General Board >> Beware of functions called 'resolve'
https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl?num=1155413767

Message started by Kris Coppieters on 08/13/06 at 08:16:06

Title: Beware of functions called 'resolve'
Post by Kris Coppieters on 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!)...


Message Board for Rorohiko Workflow Resources » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.