Feed arguments to AppleScripts?

13 views
Skip to first unread message

Trond Lossius

unread,
Aug 22, 2010, 11:56:55 AM8/22/10
to elect...@googlegroups.com
Hi Tim,

is it possible to feed arguments to an applescript in tap.applescript in a similar way to osascript?

http://hints.macworld.com/article.php?story=20050523140439734

If not, I am wondering if this could be added as a feature request sometime in the future?

Thanks,
Trond

Timothy Place

unread,
Aug 22, 2010, 12:00:32 PM8/22/10
to elect...@googlegroups.com
Hi Trond,

You can feed an entire script into tap.applescript as a Max message.
So, in theory at least, you could set up your arguments as part of
configuring the script you are going to send into tap.applescript.

Does this help?

best,
  Tim

> --
> You received this message because you subscribed to the Electrotap group.
> To unsubscribe from this group, send email to electrotap-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/electrotap?hl=en
>
> Electrotap -- http://electrotap.com/
> Tools for Innovative Music, Media, and Art
>

Trond Lossius

unread,
Aug 22, 2010, 12:07:36 PM8/22/10
to elect...@googlegroups.com
Thanks, Tim,

I tried that but I don't manage to figure out how to deal with line breaks. Here's a very simple script that works in AppleScript Editor, but not when passed to tap.applescript:

AppleScript Editor version:

beep 3
delay 5
beep 3

Message sent to tap.applescript:

script beep 3 delay 5 beep 3

Thanks,
Trond

Harlo Holmes

unread,
Aug 30, 2010, 3:38:37 PM8/30/10
to ElectroTap
I am also looking for a similar workaround. I ended up making a
string builder in javascript that takes a variable and formulates the
proper message to use with the tap.applescript object. This should
give you more control over what goes out...

Best,
Harlo



On Aug 22, 12:07 pm, Trond Lossius <trond.loss...@bek.no> wrote:
> Thanks, Tim,
>
> I tried that but I don't manage to figure out how to deal with line breaks. Here's a very simple script that works in AppleScript Editor, but not when passed to tap.applescript:
>
> AppleScript Editor version:
>
> beep 3
> delay 5
> beep 3
>
> Message sent to tap.applescript:
>
> script beep 3 delay 5 beep 3
>
> Thanks,
> Trond
>
> On Aug 22, 2010, at 6:00 PM, Timothy Place wrote:
>
>
>
>
>
>
>
> > Hi Trond,
>
> > You can feed an entire script into tap.applescript as a Max message.
> > So, in theory at least, you could set up your arguments as part of
> > configuring the script you are going to send into tap.applescript.
>
> > Does this help?
>
> > best,
> >   Tim
>
> > On Sun, Aug 22, 2010 at 10:56 AM, Trond Lossius <trond.loss...@bek.no> wrote:
> >> Hi Tim,
>
> >> is it possible to feed arguments to an applescript in tap.applescript in a similar way to osascript?
>
> >>http://hints.macworld.com/article.php?story=20050523140439734
>
> >> If not, I am wondering if this could be added as a feature request sometime in the future?
>
> >> Thanks,
> >> Trond
>
> >> --
> >> You received this message because you subscribed to the Electrotap group.
> >> To unsubscribe from this group, send email to electrotap-...@googlegroups.com
> >> For more options, visit this group athttp://groups.google.com/group/electrotap?hl=en
>
> >> Electrotap --http://electrotap.com/
> >> Tools for Innovative Music, Media, and Art
>
> > --
> > You received this message because you subscribed to the Electrotap group.
> > To unsubscribe from this group, send email to electrotap-...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/electrotap?hl=en
>
> > Electrotap --http://electrotap.com/

Andrew

unread,
Sep 21, 2010, 6:12:40 AM9/21/10
to ElectroTap
I'm running into the same issue. Has any one found a solution to the
line break issues?

@Harlo, any chance you would mind sharing your js string builder? I
would really appreciate it :-)

Thanks!

Andrew

Harlo Holmes

unread,
Oct 1, 2010, 7:19:28 PM10/1/10
to ElectroTap
Hi Andrew,

Sorry I'm so late in responding...

Unfortunately, I scrapped the patch I was working on when I figured
this out, and I can't find it anywhere. I will try to reconstruct the
process, though, but my TapTools demo expired and I haven't bought it
yet. Once again, very sorry about not being able to help out with my
code; the JS I hooked up was pretty straightforward, though.

Something like:

this.autowatch = 1;
inlets = 2;
outlets=1;

function stringParse(action,variable) {
var tapScript = "script " + action + " " + variable;
outlet(0,tapScript);
}

... and then just use the UZI object to bang those commands out one by
one?

I seem to remember that the output from the JS function had to pass
through the "from symbol" object for TapTools to understand it, but I
could be dreaming that...

I'll let you know if I come up with anything else; hoping you all will
do the same!

Harlo

Andrew Spitz

unread,
Oct 6, 2010, 2:16:32 AM10/6/10
to elect...@googlegroups.com
Hi Harlo,

Thanks so much for the response. Now I apologies for not answering earlier but I was away.

Unfortunately I can't get your js code to work... I don't know js at all, so I can't tell what's the problem, it's probably something stupid on my behalf. Thanks though! I'm using [shell], and it's working for me so I'll leave it for now, and if someone chips in with a solution it will be great for the future.

Thanks again!

Andrew~
                                                      
blog
: {sound + design}
Q&A site: Social Sound Design
 
                                                    

 



For more options, visit this group at http://groups.google.com/group/electrotap?hl=en

Electrotap -- http://electrotap.com/
Reply all
Reply to author
Forward
0 new messages