aMSN Forums
November 22, 2017, 02:02:41 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Please, How to use aMSN with AppleScript  (Read 11794 times)
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« on: August 02, 2009, 06:07:37 am »

Hello! Well, I am an Automator in my MacBook  Cool hahaha xD So, I was programming a lot of useful Apple Scripts. I want to program some for aMSN and I know that it uses TCLAe (TCL Apple Events). When I make a command like:
Code:
osascript -e 'tell application "aMSN" to do script "::MSN::connect"'

This is supposed to Login xD (IDK if it works). But always returns this message (with any script):
Code:
27:53: execution error: aMSN got an error: AEDoScriptHandler: invalid script type 'txtu', must be 'alis' or 'TEXT' (-1770)

So, How it works???

PD: I want amsn can be controlled by voice
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: August 03, 2009, 10:50:05 pm »

hey, i tried everything, it doesn't seem to work... the problem is that TkAqua doesn't seem to handle applescript correctly.. which is why there's tclAE extension which should work fine, however, when I do 'package require tclAE', it crashes... maybe it won't on your machine, but on mine it does... If it works for you, then simply do from amsn (you could add that line into some of amsn's source code, especially in reload_files in the 'Scripts/amsn' file) :
Code:
source utils/macosx/applescript/ae.tcl

I hope that helps!
Logged

KaKaRoTo
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« Reply #2 on: August 04, 2009, 12:08:40 am »

I added the code that you said, and aMSN simply crash xD. But I also was reading the source, and I found this:
Code:

if { [OnDarwin] } {
# Disable with 8.5...
if { [version_vcompare [info patchlevel] 8.5.0] == -1 } {
source [file join utils macosx applescript ae.tcl];#AppleEvent support
}
}


So, aMSN tries to open ae.tcl, but I don't know why, but It isn't loading that. Maybe my version of TclTK or a bad IF CONDITION. I don't know. If you can see it, thanks Cheesy.

PD: If I can, I want to programm and upload a nice library of AppleScripts for aMSN and a Voice Control for it =D.
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #3 on: August 04, 2009, 01:16:46 am »

Hi again.. this is interesting, I didn't notice that.. well, I guess tclAE was disabled for tcl/tk 8.5 because it makes it crash.. anyways, I've been digging around and it seems that the latest release of tclAE was in 2004, and since then, the bug with tclAE and tcl/tk 8.5 was fixed in their SVN, so I grabbed the SVN, compiled it as universal binary and reenabled the code that loads the ae.tcl file (thanks for finding that!) and aMSN doesn't crash anymore with tclAE... I tried that line that does the osascript -e tell application "aMSN", etc... and it worked perfectly, aMSN connected without any errors!
So I've now committed this into aMSN's SVN, so please update to SVN r11434 and try it out (no need to change any code or anything), it should work just fine!
I'll be waiting to see what kind of scripts you come up with! Smiley
Logged

KaKaRoTo
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« Reply #4 on: August 04, 2009, 01:22:46 am »

HAHAH! LOL! "this should make nicolunacba happy  " Thanksss! I am in the aMSN history now Cheesy ... Well, I am working on it now Cheesy Thank you Kakaroto!!!
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #5 on: August 04, 2009, 01:29:15 am »

You're welcome! surprised that someone reads my commit messages :p
Thanks to you for showing interest in that area!
Logged

KaKaRoTo
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« Reply #6 on: August 04, 2009, 05:54:06 am »

After release 11310 (asyncresolver problems in Mac OS X), I read before update xD. Hey, about the scripts: now I am reading all the source (yeah! too much xD) looking for "gui functions" like start chat with X, close tab, add user, etc. Log In was too easy (in Scripts/amsn), but the others are "hidden". Thank you for the AppleScript! I love scripting and automating all.
PD: It's too cool use Speech Recognition and say: "Mac, open aMSN. Mac, Sign in" ... and aMSN Sign in Cheesy
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #7 on: August 04, 2009, 05:35:16 pm »

hehe, ok cool Smiley so I guess you've seen my name quite often lately... hehe

Someone started this page a while ago, it might be helpful for you : http://www.amsn-project.net/wiki/Dev:UsefulFunctionsForPlugins
You could try extending it by adding whatever useful API you find and documenting it if you're willing to help! Just tell me what username/password you want by PM (you can change the password later) and I'll create a wiki account for you!
It's awesome what you're doing with speech recognition! I'd be happy to try out your scripts whenever possible! Smiley
Thanks! Smiley


p.s: oups, i wrote this yesterday but forgot to click submit...
Logged

KaKaRoTo
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« Reply #8 on: August 04, 2009, 06:11:47 pm »

My objective is give to aMSN accesibilty functions Cheesy. Thinking in, for example, my blinds friends Smiley. If I can, I like to make aMSN compatible with Morse monitors (I dont know if It's compatible now, it depends half system half software).
And nice!!! An account to me ='). But I am working yet, so .. hehe, xD Don't give me the power yet xD.
Another thing: I finished this scripts:
- Login "Mac Log in"
- Log out  "Mac Log out"
- Change status "Mac, I am 'Busy' " (or another status)
- Chat "Mac, Chat with [email]" (now I'm working in a 'alias list')
- Block user    \_(for troll buddies)
- Unblock user /
- And the about Window xD

My method to find this was: Read ALL source (I'm tired, I didn't sleep really T_T) and look for exporting functions. I want to find the function that invokes "Change nickname" or anything like that. I'll work on it today too Cheesy
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
nicolunacba
Super Power User
**
Offline Offline

Posts: 349


View Profile
« Reply #9 on: August 04, 2009, 06:35:16 pm »

Quote
Someone started this page a while ago, it might be helpful for you : http://www.amsn-project.net/wiki/Dev:UsefulFunctionsForPlugins


Oh my God!!! That's like a drug to me *¬* Awesome! Thanks for the link! I have new ideas with that Cheesy
Logged

I am a Mac user, but I use it like a Unix system ... Terminal.app for life!
cheater_boss
Newbie

Offline Offline

Posts: 12


View Profile WWW
« Reply #10 on: August 29, 2009, 06:25:52 pm »

Hey there, nicolunacba, I'm totally into AppleScripting. Plus into Voice Recognition for 3 years. I've been studying my undergraduate education on Musical Technologies. (which is mainly about digital sounds etc.) I'm from Turkey. And I would like to help you. I believe we can create miracles together.
Currently I have loads of applescripts running on my Mac Pro. I have a bluetooth headset running in my house. And I can control, almost everything with some right commands. But those are only for AppleScript supported applications.

I have googled a lot, but couldn't understand the whole idea of TCLAe. As far as I understand it is to script for non-applescript supported applications. If understood it correctly, that would be the cure for almost everything. I need some help with this aMSN Speech Recognition, + TCLAe if possible (from A-Z... I don't have any idea about it. {from installation to usage})..

Cheers to the developers, coder, and creativity-gifted people around the world Wink
Thanks  Cheesy

I'll be waiting for your reply.
Logged
Auria
Power user
*
Offline Offline

Posts: 121


View Profile
« Reply #11 on: August 29, 2009, 11:48:21 pm »

Quote from: "cheater_boss"

I have googled a lot, but couldn't understand the whole idea of TCLAe. As far as I understand it is to script for non-applescript supported applications. If understood it correctly, that would be the cure for almost everything.


Not from what I understood; I'm admitedly not a pro at this, but my understanding is that TCLAe adds support for AppleScript to apps written with the TCL programming language only, which means quite few mainstream apps actually.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #12 on: August 30, 2009, 02:09:00 am »

Hi cheater_boss, nice stuff!
with tclAE, you can do many stuff, but what we use it for with amsn, is that you can do : tell application aMSN do script "something"; end tell.. and the "something" should be an actual Tcl script.. so you could build for example a plugin for amsn in tcl and put all your code in there, then use applescript to call functions from that plugin and have it do what you want.
Logged

KaKaRoTo
cheater_boss
Newbie

Offline Offline

Posts: 12


View Profile WWW
« Reply #13 on: August 30, 2009, 08:48:20 am »

Thanks!! Cheesy Wow, Great, Quick and pretty Understandable reply. I feel great Cheesy Thanks a lot!!! Cheesy You guys are great!! OK, now I think what impresses me here under this subject is Speech Recognition, and nicolunacba has the cure Cheesy I think I need the same exact stuff Cheesy Cheesy (or at least the right plug-in nicolunacba uses to applescript amsn. Which is almost the same Cheesy but whatever.. Cheesy ) Thank you sooo much kakaroto & Auria. I'll be waiting for nicolunacba's reply Cheesy or - if somehow, someone shows up with a similar thing Cheesy I'll be following this topic Cheesy

--Another Happy Customer Cheesy Cheesy Cheesy
Logged
cheater_boss
Newbie

Offline Offline

Posts: 12


View Profile WWW
« Reply #14 on: September 04, 2009, 07:27:04 pm »

By the way, hey, I started to figure out the whole thing. Now I'm looking at the big picture Cheesy Cheesy Cheesy I think, nicolunacba's soul was also enough for this project Tongue Cheesy Never showed up after my last post, but, I solved it! yeaaaaaahhhh! Whatever Cheesy I figured out what I'm supposed to do now. At least now I know where the TCL scripts are, and I have some ideas about how to use them. I'll notify everyone. aaand I think I'll try to script out a plug-in named AppleScript, for ease of use. So people like me trying to AppleScript their ways in, will work less. If there are people willing to contribute, please pm me;) Cheesy Thanks to all aMSN team Wink Cheesy
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!