I've got the following code which works fine in Script Editor:
on run tell application "System Events" set the process_flag to (exists process "iTunes") end tell if the process_flag is false then ignoring application responses tell application "iTunes" to launch end ignoring end if tell application "iTunes" try set lib_ref to first library playlist set track_ref to first track of lib_ref tell track_ref if artworks exists then set artworkData to (data of artwork 1) return artworkData end if return null end tell end try end tell return null end run
Then the code in Xojo always returns null:
Dim xAppleScript As NSAppleScriptMBS Dim dError As Dictionary Dim xEvent As NSAppleEventDescriptorMBS xAppleScript = New NSAppleScriptMBS(AppleScriptTunesArtwork) Call xAppleScript.Compile() xEvent = xAppleScript.Execute(dError) break
Any ideas how to get iTunes song artwork?