scripting the terminal for document

i’m try to write a script and, well, i suck at it. anyway, it is fun.

what i want to do is change directories, add a date, then rename the file and then “wash” away mac endings to unix endings.

this is what i have already. it takes me to the directory, but i get bogged down at that point.

this takes me to the directory. each file is placed in a folder on the desktop and the folder is datestamped. i plug in the dates. in each folder is a file with the name “oddball.csv.(datestamp)”

i need to have the script complete the following comands it the directory:

mv oddball.csv.20040807 temp

and then:

cat temp | tr ‘r’ ‘n’ > oddball.csv.20040807

can i do this all in one step w/ applescript? i’ve tried several different ways, but getting nowhere. :shock:

You can do it via AppleScript, but you have to remember that each ‘do shell script’ is distinct and unique - it knows nothing whatsoever about what any previous ‘do shell script’ command has done.

This means the second ‘do shell script’ command that copies the file has no idea about the previous ‘do shell script’ that changed directory.

In order to do what you want you need to link all the commands together in a single ‘do shell script’ command, using semi-colons to separate the commands:

[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]