#!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP #!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP

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.

resexc2.gif (20k)




REALbasic for Dummies
by Erick Tejkowski

$19.99 @ Amazon





Files are in Stuffit 6.5 or earlier, or ZIP format.
Download Stuffit Expander

Tell us about a bad link.

MacPAD Version Checking by Seth Willits
12-17-03




Generic Introductory Rant
Is it just me or is it a humongous pain to make sure you have the latest software? You have to go looking all over the web visiting all of those sites just to look at a couple of numbers. For large software products like Adobe's or BBEdit, the programs themselves make sure they're up to date, and for Apple's software we have Software Update, but good luck remembering all of the sites where all of those little apps came from. Of course there are sites like VersionTracker and Tucows, but half the time they're not even up to date themselves. It's not their fault because sometimes the developer doesn't update it because they're lazy (I'm a perpetrator myself here), or sometimes they might not even know they're application was listed in the first place (I've been a victim several times)! There must be a solution. Well my friends, there is. MacPAD is here.

What is MacPAD?
MacPAD is a Mac-specific format of the PAD (Portable Application Document) format. A PAD file is essentially an XML file with pre-defined tags which are used to define an application and track it as new versions come out. The MacPAD format is simply a plist file with a few tag differences than its pure PAD roots. Mac-specific tags are added, and, from what I understand, redundant information has been removed.

To use a MacPAD file, all you have to do is fill out a few simple fields in the MacPAD application in the MacPAD SDK and then upload it to your webserver. From there, you would then submit the link to your MacPAD file once to all of the websites which support MacPAD. From then on, when you update your application, you would update your MacPAD file upload it to your webserver again and then all of the websites you submitted the link to would automatically update as you change your application. Pretty spiffy! Now the only downside is that at the moment there's only one site, MacShareware.net, supporting the MacPAD format, but this is believed to change over time.

However, don't be discouraged by this because there is a use beyond the simply amazing automation that it offers. You can also you use the MacPAD format and the example code in one of four languages (C, PHP, REALbasic, and Cocoa) to do your own version-checking and inform the user when your application is updated by checking whenever your application is opened.

Design
To use MacPAD in your own applications is extremely easy thanks to the code (written by Kevin Ballard) that is in the MacPAD SDK. We'll demonstrate its easy by creating our own project. Simply drop the single class into the project window and create an interface simlar to that below where <XXXXX> is the name of the appropriate control.

The Few Lines to Use It
Asking for the latest version of the software is very simple. The MacPADVersionCheckSocket class has a CheckVersion() method which simply needs a string for the MacPAD file's URL, and a version number string in the traditional x.x.x format. (It even handles numbers like 1.0b2 correctly!) So go ahead and drop that code into the Check button:

The last step is to handle the result of the check via the VersionSocket's Finished event.

(Click on the code for a full size image)

All that this code does is handle the different result code values (0-5) and display the appropriate information in the information field. There are a few other methods in the VersionSocket that can be used to retrieve useful information. They include:

  • Error Message (an English version of the result message)
  • NewVersion (the version string for the latest version)
  • ProductPageURL (the web page for the application)
  • DownloadURL (the URL to download the application)
  • ReleaseNotes (returns the product release notes for the latest version)

The Finished Product
I hope you will adopt the MacPAD format in your current and future applications. The code already exists to use it, so why not? You application becomes smart, it streamlines your own work, and you're contributing to the greater good of mankind. Maybe... Anyway, you can download the project here. Happy updating!

#!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP #!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP