What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Messenger Plus: How To Read a Text File?

Messenger Plus: How To Read a Text File?
Author: Message:
MrAsterisco
New Member
*


Posts: 1
Joined: Jun 2009
O.P. Messenger Plus: How To Read a Text File?
Hi everyone! I'm new in developing for Messenger Plus, but I'm not new in developing applications. I need your help for a script: I use Parallels Desktop to virtualize Windows on my Intel Mac; I used to use Adium, but I need some key features included only in Windows Live Messenger for Windows. At the same time, I'd like to show the song I'm listening to in iTunes (on Mac OS X) in my personal message (in Windows Live Messenger on Windows).
My first idea is to build an application for Mac that reads the song playing in iTunes and write it to a text file; then the Messenger Plus script has to read that text file and set the personal message.

I searched everywhere, but I didn't find a way to read a text file in Messenger Plus: is it possible? If yes, how?

Thanks in advance!
06-22-2009 05:45 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Messenger Plus: How To Read a Text File?
surfichris's reply to Tips
06-23-2009 03:31 AM
Profile E-Mail PM Find Quote Report
robert_dll
Full Member
***

Avatar

Posts: 393
Reputation: 8
– / Male / Flag
Joined: Aug 2008
RE: Messenger Plus: How To Read a Text File?
And how can I read something specific? For example, if I want to read the text next to "hi" in a file which content is "hi robert".
06-24-2009 10:08 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Messenger Plus: How To Read a Text File?
quote:
Originally posted by robert_dll
And how can I read something specific? For example, if I want to read the text next to "hi" in a file which content is "hi robert".
That totally depends on what is static in "hi robert".
  • If you want to read the first word of a file, you can use a regular expression on the file's content:
    js code:
    var sContent = "hi robert";
    var sResult = sContent.match(/^\b(\w+)\b/)[1];
    // Result now equals "hi" as this is the first word
  • If you know that "robert" is always the second word in the file and need to know what's in front of it:
    js code:
    var sContent = "hi robert";
    var sResult = sContent.match(/^(.+)\srobert/)[1];
    // Result now equals "hi" as this comes before "robert"
  • ...
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-25-2009 09:45 AM
Profile E-Mail PM Web Find Quote Report
robert_dll
Full Member
***

Avatar

Posts: 393
Reputation: 8
– / Male / Flag
Joined: Aug 2008
RE: Messenger Plus: How To Read a Text File?
What I want is to read the word next to "hi", but I think I can do it from here, thanks Matti
06-25-2009 02:42 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On