[TxMt] Re: run script with args
Matt Neuburg
matt at tidbits.com
Sat Oct 14 15:21:59 UTC 2006
On 10/14/06 12:03 AM, in article
CD129D28-B3B6-4F25-9C79-5B71F45BDD66 at adelaide.edu.au, "Paul McCann"
<paul.mccann at adelaide.edu.au> wrote:
> Allan wrote,
>
>>> [...] but how do I run the script I'm looking at, with arguments?
>>> [...]
>>
>> No way to do that, my reply form last time this came up http://
>> lists.macromates.com/pipermail/textmate/2006-September/013015.html
>
> but how about mimicking things by pushing onto ARGV at the top of the
> script? That is, use something like
>
> ARGV.concat(%w(/etc/file1 /Users/pmccann/file2))
That's an okay idea, but at that point I'd rather just run the script from
the Terminal, since your approach means (1) I must change the script's
internals for testing purposes, and (2) this is part of a larger problem
that can't be solved quite so easily.
Allan, if you're still reading, you might want to look at how the Perl
IDE/Debugger Affrus solves this problem:
<http://www.latenightsw.com/affrus/index.html>
A document is accompanied by metadata called "script arguments" which
determine the combinations of the perl command, switches, and arguments used
when running the script. A nice feature of this architecture is that you can
store many script arguments and then just switch among them as a way of
testing under different conditions. You might want to steal this idea for
TextMate... :) m.
--
matt neuburg, phd = matt at tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
More information about the textmate
mailing list