On May 11, 2012, at 10:45 AM, Kyle Swank wrote:
> This is fantastic and something I hadn't considered.
>
> How would you include GTMScriptRunner?
You could include the source, or you could put it in your Contents/PlugIns folder of your app bundle, and then load it dynamically (though… JSTalk might automatically do that for you. It'd be nice if it did anyway).
> Basically all I'm doing right now is creating a JSTalk item and
> telling it to execute a script inside the bundle.
>
> What I am very curious about is how to use the JSTalk:include:
> method.
That's for use from within a jstalk script, as a way to load and execute a supporting script of some sort.
(as an aside, I've recently found out that JSEvaluateScript isn't reentrant, so "bad things" might happen when you use this from within a script. I haven't encountered any problems with it yet though, but I'll have to figure out another way of doing this in the future).
> So far I've tried to use it, but it keeps telling me it cannot find
> the script. Is there a default location it looks? Or do I need to
> provide the full path? Both scripts are in the same folder inside the
> app bundle.
You can pass the full path, or you can add the original script path to JSTalk's environment as "scriptURL", and it will figure out where to load it from based on that.
> Thank you again for your help. I really appreciate it.
No problem, and let us know if you run into any more issues.