![]() 3D 3D Photo Gallery (Part 1) 3D Photo Gallery (Part 2) Audio Poor Man's MIDI Make A Metronome iPod Tricks (Part 1) iPod Tricks (Part 2) iPod Tricks (Part 3) Laugh Track Machine Audio Player with Reverb Shepard Melody RB Phone Home Build a Drum Machine Custom Controls and Windows Double Click Listbox Draggable Metal Window Double Click Canvas Custom Buttons Custom Buttons Part II iTunes-style Listboxes Custom Controls General RB Scrolling Windows Using Mesage Dialogs Case-Sensitive Word Finder Introduction to Stacks Wiggle Window JPEG in PDF Listbox Checkboxes Background Applications Listbox Auto-Find Virtual Volumes Time Tracker Software Distribution (Part 1) Software Distribution (Part 2) Software Distribution (Part 3) Software Distribution (Part 4) Exceptions Tips and Tricks Text Clippings Made Easy Graphics Drawing a Simple Gradient The SpriteSurface: Space Game Image Spinner Cropping Graphics (Part 1) Cropping Graphics (Part 2) Cropping Graphics (Part 3) Cropping Graphics (Part 4) Shimmer Graphics Lissajous Figures Simple Screen Capture Vector Graphics Kaleidoscope Images Stegonography Spirals! Image Table RB Magnifying Lens Screen Capture Color Picker Tutorial Hacks Ghost Grab Speedy Mouse Extension iTunes Plugins iTunes Skinner Mac OS X Global Hot Key Event (Carbon Events) Login Welcomer (Carbon Events) Add/Remove Buttons Resizable Sheets Mac OS X Preferences Window Using Sheets in REALbasic Build a Bundle (Part 1) Build a Bundle (Part 2) Dock Your Passwords Mac OS X Debugging REALbasic Mac OS X Icon Tutorial Animate Your Dock RB and the Command Line Menus Window Menu Templates Menu Listbox Menu Novelty Guessing Game Calendar Trivia Tile Mixer Zip Code Finder Happy Valentine's Day Merlin Simulator (Part 1) Merlin Simulator (Part 2) Merlin Simulator (Part 3) Buzzword Machine AppleSoft BASIC Printing Print to PDF Registration Registration Code Validation Network Registration Codes Resources Picture Extractor (Part 1) Picture Extractor (Part 2) Serial Caller ID (Part 1) Caller ID (Part 2) Caller ID (Part 3) Speech Speech Recognition Socket Communication Easy Peer-to-Peer File Sharing MacPAD Version Checking Display Web Image In Canvas HTML IMG Tags Version Tracking Even Smarter Instant Messaging Web Tiler JavaScript and REALbasic Stock Ticker (Part I) Stock Ticker (Part 2) AIM Mate XML Manipulation Simple XML Introduction Video Big Brother Video Capture Note: All articles without a byline were written by Erick Tejkowski. When cleaning the site I removed them because the code differed from page to page, and I have yet to put them back in.
Tell us about a bad link. |
If you're an avid user of AOL Instant Messenger, you may often find yourself retyping some of the same messages and phrases daily. Poor typing skills don't improve the situation. What's an AIM geek to do? This week we'll create a simple REALbasic application, named AIM Mate, that can help alleviate some of the more mundane typing tasks of working with Instant Messenger. Our AIM Mate project will display a list of commonly used phrases and sentences as well as a list of buddies. With the click of a button, you will be able to send any text to whomever you wish. You'll never have to type "LOL" or "BRB" again! Build the Interface Create a new REALbasic project and open Window1. Add two Listboxes and a PushButton to the window:
You can arrange the interface however you wish, but to give you an idea of where we are going with this, here's a sample:
For the sake of convenience, it would also be good to change the Frame property of Window1 to Global Floating Window. This makes the window float above all other applications, giving you easy acces while using AIM. Create Two Text Files When AIM Mate starts up, we will load two text files into the interface:
Create these two text files (SimpleText works fine for this) and place them in the same folder as your REALbasic project. Make sure you name them exactly as shown above. If you decide to change the file names, you will also need to do so in the code that follows. Add the Code Ok, enough of the preparations, let's get to the code! First, add the following code to the Open event of Window1: dim f as folderItemdim textin as textinputStream f=GetFolderItem("Buddies") if f<>nil and f.exists then textin = f.openastextFile while NOT(textin.EOF) BuddyList.addrow textin.readline wend textin.close end if f=GetFolderItem("QuickText") if f<>nil and f.exists then textin = f.openastextFile while NOT(textin.EOF) QuickTextList.addrow textin.readline wend textin.close end if This code loads the two text files you created earlier and places the contents of each in the correspdonding Listbox. Next, place the following code in the Action event of SendButton: if BuddyList.Listindex>=0 and QuickTextList.ListIndex>=0 thenSendAIM BuddyList.text,QuickTextList.text end if This code sends the currently selected text to the currently selected Buddy. But wait! What's that SendAIM command you see there? Easy, it's the name of an AppleScript that will take care of communicating with Instant Messenger for us. Create the AppleScript Launch Script Editor and create a new AppleScript: on run {x, y}tell application "AOL Instant Messenger (SM)" activate SendIM screenName x message y end tell end run Save the script as a "Compiled Script" and give it the name: SendAIM. Finally, drag the new script into your REALbasic project. Conclusion That's it! Test the project and when you're happy with the results, build the final application. Of course, you can download the application and completed project instead. Until next week! |
|||||||||||||
|
Please support ResExcellence by Visiting our Sponsors. One click makes a difference. |
||||||||||||||
|
|