Hi,
I could have sworn earlier in the day tell blocks for iTunes was working. I am not 100% sure because I am also using the "com.apple.iTunes.playerInfo" in the real app.
But below is a Simple cocoa-Applescript written in Xcode Version 6.1 (6A1052c) which is also exhibiting the same behaviour.
The direct tell application "iTunes" to work but the tell block does not. Annoying and odd..
Is anyone else getting this oddness?? anyone know what is going on??
script AppDelegate property parent : class "NSObject"
-- IBOutlets property theWindow : missing value
on applicationWillFinishLaunching_(aNotification) -- tell application "iTunes" to playPause -- tell application "iTunes" to playPause
--##THIS WORKS tell application "iTunes" to set currentTrackName to name of current track as string log "iTunes currentTrackName " & currentTrackName
--## THIS TELL BLOCK DOES NOT GET ENTERED ?? tell application "iTunes" log "HERE" set currentTrackName to name of current track as string
set trackNumber to track number of current track as string set albumArtist to album artist of current track as string if albumArtist contains "missing value" or albumArtist is "" then set albumArtist to artist of current track as string end if set trackCount to track count of current track as string
log "iTunes albumArtist " & albumArtist
end tell end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender) -- Insert code here to do any housekeeping before your application quits return current application's NSTerminateNow end applicationShouldTerminate_
end script |