Opened 11 years ago

Last modified 8 years ago

#338 new Enhancement

AS - A method to send a typed command from Applescript

Reported by: niteshade Owned by: timothy
Component: Colloquy (Mac) Version: 2.1 (Mac)
Severity: Normal Keywords: Interface, Scripts, Plugins


It might be handy to be able to send a line of text from applescript to colloquy just as though it had been typed by the user. There doesn't seem to be a way to do this. This allows applescript to send commands to Colloquy - e.g. /dcc etc. just as though they had been typed. This might help people do things that either colloquy doesn't (yet) fully support in Applescript per se, or has no interest in supporting, or for reasons specific to the scripter is the desired method of control.

Is it worth adding a new command "send typed" ? Or would it be better to add a parameter to the "send message" command

[as typed boolean] : Send as though it was typed by the user (true) or sent direct (false) Default is false.

or instead

[as command string] : where the string is the command that is sent "dcc", "ctcp", "(server specific command)" etc and the text that is send is then sent to the application/server routines that normally parse that command. Optional.

The first of these two options is the better IMHO because it lets anything that the script wants "typed" to be "typed" for whatever reasons they might want to "type" it :)

I'm guessing that this wouldn't be too hard a thing to add, and might be an ineligant way of adding power with least effort - at least while better ways are being developed. I hope you can find a way to fit it into the general structure of your dictionary grammar and syntax.


Change History (5)

comment:1 Changed 11 years ago by brennan@…

  • Keywords Interface, Scripts, Plugins added

I would like to see this too, especially for sending commands to the server, because 'send raw command' requires knowledge of the raw format of server syntax - a rather esoteric discipline. 'send raw command' may have it's uses, but if I just want a script to change my nick, I would rather use send message "/nick blah" as typed than some other weird incantation.

niteshade: 'as typed' would be weird termonology for a boolean. (The word 'as' is part of core AppleScript?, too!) says

AppleScript will change true and false in Boolean parameters to with and without. For example, if a scripter writes

send message "Fred" queuing true

it compiles to

send message "Fred" with queuing

In other words, the present participle typing' would be more in keeping with the preferred format of Applescript boolean parameters. 'simulated typing' would be an even better choice, because it makes the parameter even clearer, e.g.

send message "whatever" with simulated typing

(then when we get keyup/keydown callbacks implemented, we'll expect that they too will fire off for each simulated keystroke :P )

comment:2 Changed 11 years ago by smelton@…

I would also like to see this added.

I'd like to have the /music command run ever say 120 seconds or so.

comment:3 Changed 11 years ago by Niteshade

Brennan: I agree. Your command of AS grammar is certainly better than mine. Thanks.

Your comments about send raw command are also spot on. I wasn't able to master raw IRC commands to get what I wanted, so the particular function that was dependent on this remains unimplemented.

In my case, there are other "reasons specific to the scripter" (i.e. not appropriate to explain here) that I'm interested in typed commands - but that is just because I'm trying to do something a little non-standard, where normally one might do it a better way in Colloquy.

comment:4 Changed 11 years ago by Matt38@…

I'm putting in my Vote! I have a couple of Scripts that communicate with each other client to client with /ctcp in ircle and I've been trying to port them to Colloquy and I need that.

comment:5 Changed 8 years ago by Rinoa

  • Version changed from 2.0 (Mac) to 2.1 (Mac)

Valid as of latest build.

Add Comment

Modify Ticket

as new

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.