xXUlTiMaTeSiNXx Posted March 30, 2009 Share Posted March 30, 2009 Heya guys, well im new to this forum (Yay for my first post) and im just starting to learn AutoIT, but i am trying to write a program to autosend a file over msn, and i was wondering how to make it winwait for a msn convo as the window title is always different for every convo as the screen name is displayed in the window title, in batch it would be something like "MSN convo - *" but ovcorse this isnt batch, so how to go about this? I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
Drew Posted March 30, 2009 Share Posted March 30, 2009 (edited) I don't use MSN , but I do use trillian. I would imagine SOMETHING in the titles are the same... Anything that isn't common is windows other than MSN. You could use StringInStr and other string functions to get your desired effect ( helpfile rocks ) , and use WinWait to followup on it. Side Tip: I believe you can customize your idle message in the preferences . Edited March 30, 2009 by Drew Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 30, 2009 Author Share Posted March 30, 2009 You could use StringInStr and other string functions to get your desired effect ( helpfile rocks ) , and use WinWait to followup on it.sorry, like i say i am new, what is StringInStr? (sorry, i would look in the help file but i am curently on my linux partition)and yes, the start part of it is alwase the same, its something like "Msn conversation - **SCREEN NAME**" I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 bump. I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 StringInStr searches for a string inside of another string. http://www.autoitscript.com/autoit3/docs/f...StringInStr.htm Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 So i would use this to find the first part of the msn conversation window title? but what about the second part? could someone please write an example of the code so i understand? I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 Is the idea to have MSN messenger wait for someone to send a message to it then auto-send a file back to that person? The person/screen name that is sending the message is going to be the same every time, a group of several known screen names, or completely random unknown names? There are several different functions you can use and different ways to go about it depending on your specific purpose. The link I gave you had an example of how to use StringInStr....2 examples. Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 Is the idea to have MSN messenger wait for someone to send a message to it then auto-send a file back to that person? The person/screen name that is sending the message is going to be the same every time, a group of several known screen names, or completely random unknown names? There are several different functions you can use and different ways to go about it depending on your specific purpose. The link I gave you had an example of how to use StringInStr....2 examples.basicly heres how it should workIF *msn conversation is open & msn name = ANYSEND *file.exe I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 (edited) I don't have access to MSN messenger at the moment, but I checked some screenshots. The following might work: Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase ;MSN Messenger window title format: "screenname - Conversation" ;Following might activate the most recent MSN conversion window $convo = WinActivate("Conversation") Edit: Have you searched the forum yet? I think this has already been done, several times... Edited March 31, 2009 by MrMitchell Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 I don't have access to MSN messenger at the moment, but I checked some screenshots. The following might work: Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase ;MSN Messenger window title format: "screenname - Conversation" ;Following might activate the most recent MSN conversion window $convo = WinActivate("Conversation") Edit: Have you searched the forum yet? I think this has already been done, several times... so theoreticly this will wait for a convo with random screen name to open? I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 so theoreticly this will wait for a convo with random screen name to open?It should activate the last window that had focus if it has the word "Conversation" in the title, but not wait for it. This may wait for the window to be active after trying to activate it:WinWaitActive("Conversation") Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 It should activate the last window that had focus if it has the word "Conversation" in the title, but not wait for it. This may wait for the window to be active after trying to activate it: WinWaitActive("Conversation") so then theoreticly i should use; WinWaitActive("Conversation") Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $convo = WinActivate("Conversation") and then put my script for sending the file? I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 so then theoreticly i should use; WinWaitActive("Conversation") Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $convo = WinActivate("Conversation")oÝ÷ ٩ݶ§¦ëfÊÇ+_¢»Ø§Ø^~)^þ«¨µãh¦ëmå¢f¢´-÷~׫¶¨¶«· %w¬[(騽çtߧ(ú So this *should*: 1) Change WinTitleMatchMode options to search by substring of window title 2) Attempt to activate the last focused window with "Conversation" in the title <--This is actually optional 3) Wait until the window is active Link to comment Share on other sites More sharing options...
xXUlTiMaTeSiNXx Posted March 31, 2009 Author Share Posted March 31, 2009 awasum, thanks man! this will save me alot of time writing my script. I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size] Link to comment Share on other sites More sharing options...
MrMitchell Posted March 31, 2009 Share Posted March 31, 2009 No problem. I am not sure if it will even work, but I can check later tonight and will post again. You really should do a forum search, MSN messenger is all over the place. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now