: Applescript "expert" needed.

Larry Jorgenson
May 27th, 2005, 12:23 AM
I'm helping an old priest with Parkinson's disease make the transition from OS 9 to OS X. He recently retired as editor of a newspaper called the Prairie Messenger, a Catholic religion newspaper. As editor, his favorite program was Tex-edit (www.tex-edit.com) and he had built a half dozen or so custom applescripts for it and he wants to be able to use these in OS X. I know very little about Applescript and I have previously tried troubleshooting his scripts with great difficulty (in OS 9). Should all the scripts just contine to work in OS X? Most of them are set to use function key shortcuts and in my initial testing I seem to only get beeps when trying to run them.

The scripts themselves are designed to manipulate text files downloaded from the Catholic News Service and/or the Religious News Service. Ideally what I would like to find is some kind member who wouldn't mind taking a peak at the scripts and telling me how to modify them if necessary to work in OS X.

Anybody feeling generous?

May 29th, 2005, 03:04 PM

Larry Jorgenson
May 30th, 2005, 10:04 AM
I think I've got most of them working. The only one I'm having trouble with is one which takes some highlighted text, copies the first three words, tries to append these three words to a file path, and then save the file to the specified file path. Of course my path has changed slightly and with moving from OS 9 to X the required syntax for paths is changed. Trouble is, I don't know to what. How would I program applescript to put the path to a file into a variable in Applescript. Assume the file is inside a folder called "Andrew" inside the users home folder and that the file to be saved is entitled "First Three Words". Am I wrong to assume the path I would be looking for is ~Andrew/First Three Words?

Jun 5th, 2005, 08:16 PM

Jun 7th, 2005, 04:05 PM
Wow! I didn't know anyone in the Humboldt area even knew what a Mac was! ;) (Just kidding, I'm from Humboldt originally.) This is what you want to use to create the new folder:

set folderPath to "Macintosh HD:Users:Andrew"
set folderName to "First Three Words"
tell application "Finder"
make new folder at folder folderPath with properties {name:folderName}
end tell

For the path, "Macintosh HD" is the name of the hard drive in the computer. "Users" is the default directory that user accounts are created in. "Andrew" is the user folder you would like the new directory stored in.

While "~Andrew" would be the proper way to refer to the directory in the Terminal window, AppleScript doesn't seem to like that format

Larry Jorgenson
Jun 7th, 2005, 04:23 PM
Thanks. I actually found this out on my own eventually and it is working fine.