I am making a simple program to control iTunes, here is the source code:
on clicked theObject
tell application "iTunes" to activate
tell application "iTunes"
set playerState to player state
if playerState is playing then
playpause
else
set theTrack to current track
set contents of text field "SongTitle" to theTrack
end if
end tell
end clicked
The error I get is:
Building target “iTunes Test” of project “iTunes Test” with configuration “Debug” ” (1 error)
cd “/Users/dan/iTunes Test”
/usr/bin/osacompile -d -i /System/Library/Frameworks/AppleScriptKit.framework -U iTunes\ Test.applescript -o /Users/dan/iTunes\ Test/build/Debug/iTunes\ Test.app/Contents/Resources/Scripts/iTunes\ Test.scpt /Users/dan/iTunes\ Test/iTunes\ Test.applescript
/Users/dan/iTunes Test/iTunes Test.applescript:26: A " can’t go after this identifier. (-2740)
Command /usr/bin/osacompile failed with exit code 1
I have also tried this code for the track title:
set contents of text field "SongTitle" of window "iTunes Test" to theTrack
Thanks for the help,
Dan
Model: Macbook Pro
Browser: Firefox 1.5.0.7
Operating System: Mac OS X (10.4)