Use a variable in AppleScript
Hello,
I'm a very beginner in AppleScript and I juste want to test some functions to include in Automator.
So, for example, I want to pass a track in a fonction to get the played count.
Here is my script :
on run {input, parameters}
set t to input
set currentCount to getCount(t)
return currentCount
end run
on getCount(t)
tell application "iTunes"
set currentCount to played count of t
end tell
return currentCount
end getCount
But I have an error and my script doesn't work, it seems I can't use "played count of t".
What's wrong ? Thx for your help.