Purpose
Manipulate files and folders.
Requirements
You’ll need the following things to use CronShell:
- The Scriptable Finder.
- You don’t need it, but the whole point of CronShell is to use it with Cron
Using it with Cron
CronShell takes commands from Cron’s crontab command lines. For example, the crontab line:
36 17 * * * Test CronShell "enter Negative Space:Desktop Folder" "rename Politics to Peanuts" "move Peanuts to Comments"
will change the name of the file “Politics” in the desktop folder to “Peanuts”, and then move this file to the folder “Comments”. (If there is no folder “Comments”, the “move” will rename the file again, from “Peanuts” to “Comments”.)
As I mentioned, you don’t need Cron to use CronShell. You could also have dropped the file
enter Negative Space:Desktop Folder
rename Politics to Peanuts
move Peanuts to Comments
onto CronShell, and CronShell would have executed the commands as if it received them from Cron. But what’s the point? You might as well do it in the Finder. That’s why you bought a Macintosh, doofus.
CronShell uses the same standard as the Finder for separating filenames from the folders they’re in. The file “Politics” in folder “Comments”, in the folder “Apples”, on the hard drive “MacDuff” can be referred to as:
MacDuff:Apples:Comments:Politics
You can use the following commands with CronShell:
- copy item one to item two
- Creates a duplicate of a folder or file. “Item two” can move the duplicate to a different folder, and/or set the duplicate’s name.
- enter folder
- Change to folder as your default folder. If you specify “soft” filenames (filenames without their folders), CronShell assumes the files are in the default folder.
- grab item
- Sets the name of the item that can be referenced as “it”. For example, you can “grab Moderated Lists” and then “rename it to Moderated Mailing Lists”.
- log logfile or on or off
- Turns logging on or off, or sets the logfile. The logfile is not dependent on the default folder.
- move old name to new location or name
- Moves the file or folder to a new location, optionally renaming it along the way.
- rename item to new name
- Renames the file or folder.
- start application name
- Launches the application.
- quit application name
- Tells the application to quit. Note that you can start any application, but you can only quit applications that understand the “Quit” appleevent.
- trash item
- Puts the item in the trash. It does not empty the trash. You’ll have to do that on your own.