For example:
set the_script to "beep 3"
run script the_script
Don't forget that you need to escape quotes and other items:
set the_script to "say \"hello\""
run script the_script
try
run script (text returned of (display dialog "Please type a script to run:" default answer (return & return & return & return & return)))
on error err
display dialog err
end try
Or, you can run a script with the path to a file:
set the_file to "Crocs:Users:oliver:Documents:Applescripts:Convert to MP3.app:" as alias
try
run script (the_file)
on error err
display dialog err
end try
set the_file to choose file
try
run script (the_file)
on error err
display dialog err
end try
Finally, you can run a script using the clipboard:
try
run script (the clipboard)
on error err
display dialog err
end try
Notice that in the last four examples, I made sure that the script would notify you if it has a problem.












