I wrote a simple script that finds out how many active processes are running on the machine right now, and outputs the paths of each one into an array as a string.
Here's my code (it really has no legitimate function, I'm just trying to try different things to see how applescript works):
tell application "System Events"
set activeProcess to number of process
set paths to {0}
repeat with n from 1 to activeProcess
set last item of list paths to (file of process n as string)
end repeat
end tell
And here's the error applescript editor returns when I hit run:
System Events got an error: Can’t set list {0} to "Macintosh HD:System:Library:CoreServices:loginwindow.app:".
What am I don't wrong?