Adium
Dock Icons Emoticons Contact List Styles Message Styles Sound Sets AppleScripts Status Icons Service Icons Menu Bar Icons Plugins Miscellaneous All
Change Over Time

Change Over Time

Submitted By Whitney Young (wbyoung)

Description

The script in "Change Over Time (File)" allows you to specify a file on your computer from which to choose a random bit of text to insert.

The script takes three arguments:
1) The path of the file on your computer (you can use "~" to represent your home folder)
2) How often (in minutes) the text should change
3) A seed to randomize selection (use 0 if you don't understand)

Example:
A text file with contents:

This would be displayed first
This would be displayed second
This would be displayed third


Could be created, saved to the desktop, and each of those three lines would be displayed every 5 minutes with the script call %_randFromFile{~/Desktop/file.txt,5,0}.

------------

The second set of scripts - "Change Over Time (Directory)" - allow a little more freedom in your selection of text (since they don't just split at line breaks).

The first script will select a file randomly from a folder and will insert the contents of that file. Use plain text format, and don't leave any files in the directory that aren't plain text. It takes three arguments:
1) The path of the folder on your computer (you can use "~" to represent your home folder)
2) How often (in minutes) the text should change
3) A seed to randomize selection (use 0 if you don't understand)
The second script will show the name of the file if you specify the same directory, the same time interval, and the same seed.

An excellent use of this script package would be to have a folder full of quotes saved to text files with the name of the person who said the quote. You could then have two random quotes on the bottom of your profile that changed daily by using the following:

"%_randFromDir{~/documents/profile quotes,1440,0}"
- %_fileNameFromDir{~/documents/profile quotes,1440,0}

"%_randFromDir{~/documents/profile quotes,1440,1}"
- %_fileNameFromDir{~/documents/profile quotes,1440,1}

Comments

You can reply to individual comments by clicking the "Reply" link next to each.

# by eevyl on 07/05/04 at 13:07:50

Nice, but why not just use linebreaks as separators?

# by wbyoung on 07/05/04 at 14:49:19

Because if someone wants to have line breaks in what their message, they can do that. I also just added another script to this set (which I'll post soon) that uses the contents of a folder.

# by eevyl on 07/21/04 at 04:31:46

Another suggestion, what about adding a parameter just in case you have a character for "comments" in the source text file?

I say it just because I would use this script with the adiumx.com slogan text file :P

# by wbyoung on 07/21/04 at 09:27:08

Well after using these scripts for a while I realized that they are extremely slow and Adium doesn't handle slow scripts all that well. Taking out comments would slow down the scripts more.

# by on 07/04/05 at 23:25:42

The randFromFile seems to have trouble when it is called more than once in the same away message. I have one where it picks three adjectives at random from a file, and displays "[adj1], [adj2], and [adj3]." As of Adium 0.8, this no longer works - in fact, it causes Adium to crash. But I can get it to work if I simply call it once. Phooey. Hope you fix this soon!

Post a New Comment

You must be logged in to post comments.

Install | Download
23.78kb (523 downloads)

12345
3.10 / 107 votes
Current Version: 1.2
Last Updated: 11/11/04
Credits:
Thanks to Martin Crisp for helping me speed up the script some.