Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > What are you most useful scripts?

What are you most useful scripts?
Thread Tools
Mac Elite
Join Date: Dec 1999
Location: Decatur, GA
Status: Offline
Reply With Quote
Jul 8, 2000, 07:46 AM
A couple of my simple scripts are below:
This one mounts a CDROM in my CDRW drive, via Toast. It's pretty fast, and mounts the CD faster that the iMac DVDROM will.
tell application "Adaptec Toast 4.1"
mount CD
end tell

The next one is obvious, and comes in handy with Virtual PC and rebuilding the desktop:
tell application "Finder"
end tell

I also had a couple that connected/disconnected from the internet, but I found them a bit buggy.

So, anyone else care to share?
Reply With Quote
Jul 9, 2000, 07:56 AM
A useful script for converting several files to open automatically with BBEdit:

on open inputFiles
tell application "Finder"
repeat with x in inputFiles
set creator type of x to "R*ch"
set file type of x to "TEXT"
end repeat
end tell
end open
Fresh-Faced Recruit
Join Date: Oct 1999
Location: Decatur
Status: Offline
Reply With Quote
Jul 13, 2000, 03:40 PM
I hasten to say that I did not write either of these, but I have adapted them. The first will open a list of your favorites sites in iCab--it can be easily adapted for other browsers:

tell application "iCab" -- Make sure the name matches yours exactly!


OpenURL "http://www.macsurfer.com/" toWindow 1
OpenURL "http://www.pdn-pix.com/cgi-bin/webbbs/config.pl" toWindow 2
OpenURL "http://macscripter.net/" toWindow 3
OpenURL "http://www.versiontracker.com/" toWindow 4
OpenURL "http://ap.tbo.com/ap/breaking/index.htm" toWindow 5
call OneClick button "size window (full w/sys bar)" on palette "side"

end tell

Obviously, these are my fave HTTP's, simply insert your own.
The last part triggers a OneClick button which positions the window the way I like it--the others are stacked underneath. You can delete that part .

I was going to post another which will open any window you are browsing in iCab and open it in IE, which is handy sometimes. I got it from the current "Script of the Week" at mascripter.net and then adapted it somewhat.
However, it is copyrighted (although yours for the taking) and quite lengthy. It's called "URL Butler" and I find myself using it a lot.
Reply With Quote
Jul 18, 2000, 05:08 PM
Speak Current Time:

--Apple's high quality voices typically offer more realistic syntax and pronunciation than regular voices
--and therefore the script may have to be tweaked depending on the current voices installed and/or used.

set this_date to (the current date) as string
-- "Tuesday, April 13, 1999 12:05:51 PM"

set hr to word 5 of this_date
set mn to word 6 of this_date
if word 8 of this_date is "AM" then
set AMPM to "A.M."
set AMPM to "P.M."
end if

say "The time is " & hr & ":" & mn & " " & AMPM using "Victoria, high quality"
K.C. Lofty
Reply With Quote
Jul 20, 2000, 11:44 AM
I think the applescript "desktop icon manager" available thru resexcellence.com is the the handiest script that i use... i hate when my desktop rearranges itself.

One click and everything is back to where i want it.

I did modify it a touch to put the apswitcher in its place too.
Clinically Insane
Join Date: Apr 2000
Status: Offline
Reply With Quote
Jul 28, 2000, 06:40 AM
This script just deletes any items from the Recent Documents folder. Its very basic, but I find it handy. Stick it in the startup and shutdown items folders.

tell application "Finder"
delete contents of folder "Recent Documents" of folder "Apple Menu Items" of folder "System Folder" of startup disk
end tell

I also have one that randomly rotates startup screens (preserving name), and when not in use stores then in another folder... if you want, ask.

Dedicated MacNNer
Join Date: May 2000
Location: Chattanooga, TN
Status: Offline
Reply With Quote
Jul 28, 2000, 08:08 AM
I have a couple that I use on a regular basis. One arranges the server volumes on my desktop in alphabetical order, another switches my TCP/IP settings (unmounting all network volumes, quitting all open applications, and closing open fonts in Suitcase) to go from LAN to Internet. Another one runs a perl script to download Showtimes info for my Palm IIIx. If anyone is interested in how I implemented any of these let me know, and I'll post the code.
Professional Poster
Join Date: Mar 1999
Status: Offline
Reply With Quote
Jul 28, 2000, 08:46 AM
i always recommend Quit Them to my newbie Mac-using friends...

they love it... it quits all open apps, as you may have guessed, and it is free
Senior User
Join Date: Jul 2000
Location: Istanbul
Status: Offline
Reply With Quote
Aug 1, 2000, 09:36 PM
Wow. Favorite AS's what a great thread... but man there are just SO many!

Here's my "hit list":

1) A modification of the "Connect to..." AS that shipped with the MacOS a while back. This script (assigned to the F11 key) allows me to open my default web browser, type in any given URL and/or press a single button to gain access to my web-based email.

2) Didn't make 'em, but the Apple Data Detectors (http://www.apple.com/applescript/data_detectors/overview.00.html) are one of the most useful AS suites ever created IMHO.

3) Also a script i created for my former Mac lab management position would allow a local folder to simulate a remote server directory by utilitizing a combo of Fetch, Folder Actions, and a neato Scripting Addition called "Dialog Director". Drop any number of files/folders on the local upload folder and they are compressed, uploaded to the server you specify. You are then given a custom URL to access them in the future and given the option to move the local copies to the trash or documents folder.

4) In tandem with the "AudioCDgh" Scripting Addition, i created 4 scripts for CD-ROM Play/Stop, Rewind, Fast-Forward, and Eject. Assigning these to F1->F4 allows me to navigate my audio CDs just like a standard audio CD player. I have also added optional routines that will actually display the title name/number when switching and/or speak the name/number of the track. Here's the Rewind script, email me at: [email protected] if you want the others:

set numDrives to number of cd drives -- how many cd drives are attached to this computer

repeat with whichDrive from 1 to numDrives
set cd volume in drive whichDrive to 240 -- remember loudest is 255
set statusInfo to status of audio cd in drive whichDrive -- check for disk existence
set totalTracks to (number of tracks on audio cd)
set currentTrack to (track of statusInfo)
set previousTrack to (currentTrack - 1)
if (currentTrack > 1) then
-- set previousTrackName to (get audio cd title for track previousTrack)
-- display dialog "Track " & previousTrack & ":
-- " & previousTrackName with icon note buttons {""} giving up after 1
-- can also have title of next track spoken by replacing "display dialog " with: "say nextTrack"
play audio cd beginning with previous track
-- set previousTrackName to (get audio cd title for track 1)
-- display dialog "Track " & "1" & ":
-- " & previousTrackName with icon note buttons {""} giving up after 1
play audio cd starting with track 1
end if
on error
display dialog "No disk in CD-ROM drive." with icon caution buttons "" giving up after 1
end try
end repeat

Too bad more folks didn't know about AS - it's SO powerful! Truly the hidden jewel of the MacOS.


[This message has been edited by SpeedRacer (edited 08-01-2000).]
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Privacy Policy
All times are GMT -4. The time now is 11:21 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,