AAIR (Aaon's AIO iChat Remote)

Any ideas on when you’ll release v2 ?

By the way, I have added 2 new plugins and added them into the commands list too but I keep getting “invalid command” :frowning:

One is to tell me the date :slight_smile: the other will say “Hello! Just type a command and I’ll carry it out!” when I say “Hi”

Actually it’s done.:D:D I want to rewrite the plugins that I have right now though and eliminate the help command. So you would have “time help” instead of “help time”. Plus I wanted to go through and clean things up a bit.

Yay! Cool! Ok! :smiley:

2.0 is out. OP has been edited to reflect changes. Including template for plugin.

PandoraBoy Plugin – save as “PandoraBoy.scpt”

property plugin : "PandoraBoy" -- Replace 'missing' with exact name of plugin. No spaces. Example if I saved this plugin as time.scpt I would put the word time in place of "missing." 

on AAIR(theMessage, staticCommand, dynamicCommand, weatherLoc)
	
	try
		
		if dynamicCommand is "/?" then -- This is for returning extra information about plugin.
			set theResponse to plugin & " [next station, previous station, next track, pp, thumbs]
Allows control of PandoraBoy.
	
PandoraBoy Options:
next station		switches to next station
pretious station	switches to previous station
next track			switches to next track
pp					play/pause
thumbs [up,down]	rate up or down (PandoraBoy thumbs up)"
			
		else if dynamicCommand is "next station" then
			tell application "PandoraBoy" to set current station to next station
			set theResponse to "Next station selected."
			
		else if dynamicCommand is "previous station" then
			tell application "PandoraBoy" to set current station to previous station
			set theResponse to "Previous station selected."
			
		else if dynamicCommand is "next track" then
			tell application "PandoraBoy" to next track
			set theResponse to "Playing next track."
			
		else if dynamicCommand is "pp" then
			tell application "PandoraBoy" to playpause
			set theResponse to "PandoraBoy Play/Pause."
			
		else if dynamicCommand is "thumbs up" then
			tell application "PandoraBoy" to thumbs up
			set theResponse to "Track rated thumbs up!"
			
		else if dynamicCommand is "thumbs down" then
			tell application "PandoraBoy" to thumbs down
			set theResponse to "Track rated thumbs down!"
			
		else
			set theResponse to "Unknown command " & dynamicCommand & "."
			
		end if
		
	on error error_message
		set theResponse to (plugin & " Control. " & error_message)
	end try
	
	return theResponse
end AAIR

(*add additional handlers here if needed*)

Hey, I’ve been trying to do a screenshot plugin…


set screenShotFile to (path to desktop as text) & "screenshot_" & (do shell script "date +%Y%m%d%H%M%S") & ".png"

do shell script "screencapture -m " & quoted form of POSIX path of screenShotFile
tell application "iChat"
    send file screenShotFile to theChat
end tell
delay 6
tell application "Finder"
    delete screenShotFile
end tell

The 6 second delay is enough for me to accept the transfer. How do I make this into a plugin since I can only return text, not images?

Sorry, this might not really help and Im just stabbing in the dark. (REEEAAAALLLLYYYYYY SICK) try to return the image. You have the location saved in screenshotfile. If no one helps when I am better (6-8 days is what I am told) I will give you a hand.

again stabbing in the dark but in the plugin


try
return screenShotFile
on error error_message
return error_message

If that works, the main script already has something like

tell application "iChat"
send file screenShotFile to theChat
end tell

And if your code works just have your plugin send the file and return a response from plugin as “file sent”

I just realised I could use

do shell script "screencapture -c "

which puts the screenshot on the clipboard, then paste it into the chat. Howzat?

Awesome Script!

I’m going to try this out :stuck_out_tongue: