Run Apple Script with an AppleScript

Hello,

I’m quite new to AppleScript and I need one AppleScript to run other AppleScripts for encoding audio files in a batch. Each script will encode 4 files (i.e. one encoding process per processor).

An example of the scripts I need to run is:

tell application "Finder"
	do shell script "cd /Volumes/G5/usr/local/bin/;nice ./lame  -q 2 -b 320 -t   /Volumes/Lager/audio/wav/007895_Sharonas_RiotForHire_ohne_4.WAV  /Volumes/Lager/audio/mp3_320/007895_Sharonas_RiotForHire_ohne_4.WAV.mp3 & nice ./lame  -q 2 -b 320 -t   /Volumes/Lager/audio/wav/008725_LivioTracksRubenMandolini_31February_ohne_3.WAV  /Volumes/Lager/audio/mp3_320/008725_LivioTracksRubenMandolini_31February_ohne_3.WAV.mp3 & nice ./lame  -q 2 -b 320 -t   /Volumes/Lager/ftp/audio/wav/008821_Kon_Allthatshew_FrancescoConteGiorgioConteDanc.WAV  /Volumes/Lager/audio/mp3_320/008821_Kon_Allthatshew_FrancescoConteGiorgioConteDanc.WAV.mp3 & nice ./lame  -q 2 -b 320 -t   /Volumes/Lager/ftp/audio/wav/008822_Kon_Allthatshew_FrancescoConteGiorgioConteDanc.WAV  /Volumes/Lager/audio/mp3_320/008822_Kon_Allthatshew_FrancescoConteGiorgioConteDanc.WAV.mp3"
end tell

I need a script that starts all scripts as a batch one after another. The “batch” script should be located in the same folder as the single scripts.

It’s probably a studip newbie question but I’d be happy to get some help :slight_smile:

Browser: Firefox 2.0.0.4
Operating System: Mac OS X (10.4)

Hi;

You don’t need the Finder to run a shell script. Assuming you’d like each of your scripts to finish before proceeding to the next, why not just make them handlers and call them right after the other?

I run scripts from scripts daily, the most efficient way of calling is:


	tell (load script file ((((path to library folder) as string) & "Scripts:Internet Services:Location Manager.scpt") as string)) to set res to run

Your’re not getting every detail if errors occur, however.

Thanks this work great except Script Editor returns an error that my script seemed not to be an AppleScript. If I open my scripts in Script editor, they look fine and I do not get this message if if save the scripts after opening in script editor. Maybe there this sonething wrong in headers of my scripts, they are gernertaed via FileMaker but the Creator/Type is set to ToyS/osas…

Any idea on this?

A handler that processes all scripts added to a speficif folder and deltes them afterwards would be terrific but I have no idea who handlers work… maybe I find something here…

That’s why we have a bunch of tutorials. See this first of three on handlers (the other two are linked in this one):

Getting Started with Handlers (Part 1 of 3-part Tutorial)