on substitute(arg)
tell application "Adium"
repeat with i from 1 to arg
send the active chat of the first interface controller message "/nudge"
end repeat
end tell
end substitute
When the code executes, I'd like for Adium to send the nudges one after another; however, it currently sends them all at once. I've tried adding a delay command in the loop with no effect (other than delaying the all-in-one delivery of nudges). Any ideas on how I can fix this?
Since Adium executes the script all at once, you have to use some sleight of hand. You'll need two parts, I belive. Have the applescript run a second thing -- another applescript or shell script which itself uses osascript to execute the applescript -- in a way that won't wait for called external program to finish.
on run argv
repeat with i from 1 to first item of argv
tell application "Adium"
send the active chat of the first interface controller message "/nudge"
end tell
end repeat
end run