Message from discussion
Include JSTalk framework in a project?
Received: by 10.68.234.38 with SMTP id ub6mr11621017pbc.2.1336764558199;
Fri, 11 May 2012 12:29:18 -0700 (PDT)
X-BeenThere: jstalk-dev@googlegroups.com
Received: by 10.68.229.197 with SMTP id ss5ls8347076pbc.2.gmail; Fri, 11 May
2012 12:29:17 -0700 (PDT)
Received: by 10.68.191.225 with SMTP id hb1mr11599689pbc.5.1336764557871;
Fri, 11 May 2012 12:29:17 -0700 (PDT)
Received: by 10.68.191.225 with SMTP id hb1mr11599688pbc.5.1336764557862;
Fri, 11 May 2012 12:29:17 -0700 (PDT)
Return-Path: <g...@flyingmeat.com>
Received: from elvis.mu.org (elvis.mu.org. [192.203.228.196])
by gmr-mx.google.com with ESMTP id gp10si2630583pbc.2.2012.05.11.12.29.17;
Fri, 11 May 2012 12:29:17 -0700 (PDT)
Received-SPF: neutral (google.com: 192.203.228.196 is neither permitted nor denied by best guess record for domain of g...@flyingmeat.com) client-ip=192.203.228.196;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.203.228.196 is neither permitted nor denied by best guess record for domain of g...@flyingmeat.com) smtp.mail=...@flyingmeat.com
Received: from [10.1.10.6] (c-71-197-184-151.hsd1.wa.comcast.net [71.197.184.151])
by elvis.mu.org (Postfix) with ESMTPSA id 508171A3C41
for <jstalk-dev@googlegroups.com>; Fri, 11 May 2012 12:29:17 -0700 (PDT)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Apple Message framework v1278)
Subject: Re: Include JSTalk framework in a project?
From: Gus Mueller <g...@flyingmeat.com>
In-Reply-To: <6d1e4e50-51fc-4f7b-8e0c-51e8640df650@vy9g2000pbc.googlegroups.com>
Date: Fri, 11 May 2012 12:29:16 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <4DAC9945-E939-4873-AA7F-89C6674AD3BB@flyingmeat.com>
References: <32a3f800-43a3-4e02-8f45-11711bb3e238@t2g2000pbg.googlegroups.com> <36c54161-c585-4a5f-9b45-c44225fac7a3@wp13g2000pbb.googlegroups.com> <2DD25F1E-AFBC-4A7B-A1EB-C2D77F88FE36@flyingmeat.com> <6d1e4e50-51fc-4f7b-8e0c-51e8640df650@vy9g2000pbc.googlegroups.com>
To: jstalk-dev@googlegroups.com
X-Mailer: Apple Mail (2.1278)
On May 11, 2012, at 10:45 AM, Kyle Swank wrote:
> This is fantastic and something I hadn't considered.
>=20
> 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=85 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.
>=20
> 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.
-gus
-- =20
August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.com/