Last Modified: 12/30/2008
 contact: Chipp Walters
Home altSQLite Newsletter Column MagicCarpet About Downloads altPlugins Links Useful Scripts Notes Tutorials Chipp.com ButtonGadget Video Tutorials Synergy for OSX Misc Search
Useful Scripts
Some scripts I find useful when perusing the mailists.
Drag Window
This script lets users move a window by clicking anywhere on the window and dragging. It's great for decoration-free windows such as splash screens and small tool palettes. Update 01/01/04: Scott Rossi posted this script recently in WindowLab, one of his downloadable stacks at www.tactilemedia.com
Get IP Address of Local Computer
From Dar Scott
Using asteriks for passwords in a field
Use this in the field script of a 'password' field. Then check the global 'thisPassword' for the string value (or you could create a custom property for the field and write to it)
Send Email on Windows
Ken Ray recently posted this script and I thought it very helpful (though I haven't tested it yet)
Mark Luetzelschwab's Acrobat Launch Script - Both Mac and PC
Mark posted this recently.
Hi Ken, (and others)
This is the end result - it seems to work quite well on 2000 and 98. Quite a bit simpler than using query registry, etc. Works for any kind of file *that is properly associated with an application*.
I still have to add the error handling in case I get an error from the shell script.
Both mac and PC code are here - the mac uses AppleScript
This is a newly updated launch script from Mark
The old one died on some Win98 machines.

New Fix Extension from Monte
Hi Chipp

I just thought I'd email you this code that does something like to the code on your site but allows for filenames with "." in them.

Cheers

Monte Goulding

Check Extension
This is a function called 'fixExt' I use to make sure the extension is set properly for Windows machines after an "ask file" operation.

Fixing XP default background color
Posted 9/14/2002 by Monte Goulding to the MetaCard Mailing List

Thanks Monte!
(This tip and an associated link can also be found on Ken Ray's fine Rev/MC website).
I’ve noticed that on WinXP the background color of mc apps is white. It seems that MacroSoft decided to introduce an new registry entry so they could have menu’s one color and menubars another color. Previously the normal stack backgroundColor has been stored in:

HKEY_CURRENT_USER\Control Panel\Colors\Menu

but now this is the color of menu panels and the normal backgroundColor is stored in:

HKEY_CURRENT_USER\Control Panel\Colors\MenuBar

I’ve informed Scott of this problem and await his comments but for now here’s the workaround script: (If you put it in the startup handler of your main/standalone stack then the correct color is inherited by all other stacks.)

Unlock file shell script (Thanks Ken Ray for your help!)

Note: need to put the 'quotes' around the file in the event the path contains spaces.
altFileSize function
This function returns a files size in bytes. Thanks Ken, Sarah and Jerry.
centering the ask/answer window in Windows
The Mac automatically does this, but in Windows you'll need to add extra code if you want to set the position of the ask/answer dialogs to the screenloc. You should use "answer Dialog" for the answer command. (Thanks Jerry Daniels)
Wait with messages
Recently, "Chipp Walters" <chipp at chipp.com> wrote: >

Can you provide an example where you would use one and not the other or > not 'send'?

Chipp -- I didn't see too many other responses here so I'll chime in... One thing I recently started using "wait with messages" for is queuing a set of sounds for playback. I was a staunch advocate for using "send in" to monitor the status of media using all sorts of custom timers and what-not. But then it occurred to me that "wait with messages" should achieve the same result, and it seems to work great. As a simple example:

The above handler will play a list of audioClips sent to it with a 1/2 second delay between each clip. Now playing audio by itself is not very overwhelming until you realize that the above repeat loop will run virtually asynchronously while other scripts are running: mouse tracking, button clicks, hiding/showing images, pretty much anything. Another way to use "wait with messages" is card or stack initialization for any set of events that take time to process (such as setting fileNames of players and starting playback).

I've only just started getting into this technique but so far it involves less scripting and maintenance than "send in" and it virtually eliminates stray message loops winding up in the pendingMessages. My impression is that "wait with messages" is pretty much the same as "send in" but without control or access to the messages being sent by the engine. I'd like to see Scott Raney chime on this from a technical level to know what the real differences are, if any.

Anyway, while some folks on the list may be put off by the lack of real "external" message threading, the "internal" threading within Rev is pretty phenomenal once you start to play around with it.

Regards, Scott Rossi
Creative Director Tactile Media, Development & Design
GetShortPathName
Creates 8.3 path names for Windows.

Remove blank lines from text
From D.Rothe.

Check for Internet Connection
Sarah Reichelt use-revolution@lists.runrev.com Wed Jan 16 18:43:02 2002




Add Comment

Check for Internet Connection 2
Here's Jerry Daniels Internet Connectivity test
Cancelling a specific Pending Message
Here's a nifty script from Ken Ray
Setting up document icons to display correctly on WinXP
Here's a handler which should be called on startup in your application. It will check the registry and make sure your document files have the correct icons and will launch your .exe when a document is double-clicked.
Getting the filetype of a file on MacOS
Here's a fucntion from Eric Chatonet which returns the fileType of a given file.
LineOffset tip
Chatting w/ Ken Ray tonight, he shared a really cool tip...one I didn't know. The lineOffset function returns the line number of the first occurence of a matching string. So if you have a list tList: A,apple B,bacon C,carrot And you use put lineOffset("C",tList) it will return '2' because 'c' is in 'bacon' and that's on line 2. Of course what we want is to find the first occurence of a line STARTING with 'C'. Many of you know that lineOffset doesn't work with regular expressions. So doing something like: put lineOffset("C*",tList) won't work. But, it turns out this will do the job! put lineOffset(cr & "C",cr & tList) The first cr makes sure the line you're looking for starts with 'C' and the second one is used to 'sync' up the number you're returning. Thanks Ken!


Technology by: Altuit, Inc. | top