<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Executing RoboFont scripts with an other RoboFont script]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I have al bunch of observers living in my *observers folders in the scripts folder of RoboFont.<br />
I want to build a script which show all the observers in that folder as a checkBoxList.<br />
Checking the box is execute that specific observer script.</p>
<p dir="auto">But there is a problem:<br />
if i <code>import &lt;hereMyObserver&gt;</code> I get errors like <code>CurrentFont</code> is not defined...<br />
If I run the observer script manually of course everything is fine.</p>
<p dir="auto">If I try to <code>execfile(&lt;hereMyObserver&gt;.py)</code> global vars (<code>event</code> is not defined) and imports (<code>fill</code> is not defined) are unknown...</p>
<p dir="auto">the cwd is my *observers folder!</p>
<p dir="auto">Hope I made myself clear on this.<br />
Is there something wrong with my thinking and the way python is (not) working? Please help :)</p>
<p dir="auto">Cheers, Thom</p>
]]></description><link>https://forum.robofont.com/topic/314/executing-robofont-scripts-with-an-other-robofont-script</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 10:42:26 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/314.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Apr 2014 16:40:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Executing RoboFont scripts with an other RoboFont script on Wed, 03 Jan 2018 11:49:57 GMT]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I have al bunch of observers living in my *observers folders in the scripts folder of RoboFont.<br />
I want to build a script which show all the observers in that folder as a checkBoxList.<br />
Checking the box is execute that specific observer script.</p>
<p dir="auto">But there is a problem:<br />
if i <code>import &lt;hereMyObserver&gt;</code> I get errors like <code>CurrentFont</code> is not defined...<br />
If I run the observer script manually of course everything is fine.</p>
<p dir="auto">If I try to <code>execfile(&lt;hereMyObserver&gt;.py)</code> global vars (<code>event</code> is not defined) and imports (<code>fill</code> is not defined) are unknown...</p>
<p dir="auto">the cwd is my *observers folder!</p>
<p dir="auto">Hope I made myself clear on this.<br />
Is there something wrong with my thinking and the way python is (not) working? Please help :)</p>
<p dir="auto">Cheers, Thom</p>
]]></description><link>https://forum.robofont.com/post/314</link><guid isPermaLink="true">https://forum.robofont.com/post/314</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Wed, 03 Jan 2018 11:49:57 GMT</pubDate></item><item><title><![CDATA[Reply to Executing RoboFont scripts with an other RoboFont script on Wed, 03 Jan 2018 11:49:34 GMT]]></title><description><![CDATA[<p dir="auto">He Thom</p>
<p dir="auto">use in your "external" scripts</p>
<pre><code class="language-python">from robofab.world import CurrentFont
</code></pre>
<p dir="auto">or</p>
<pre><code class="language-python">from mojo.roboFont import CurrentFont
</code></pre>
<p dir="auto">Those global variables (<code>CurrentFont</code>, <code>CurrentGlyph</code>, …) are injected in the main script automatically.</p>
<p dir="auto">good luck!</p>
]]></description><link>https://forum.robofont.com/post/1205</link><guid isPermaLink="true">https://forum.robofont.com/post/1205</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 11:49:34 GMT</pubDate></item></channel></rss>