When I run the following script, the value returned is of type ‘utxt’. That
type is not one of the “native” types defined in osx/ae_constants.rb.
Therefore, when I call to_rbobj on the returned object the object is not
turned into a string.
The type ‘utxt’ seems to be returned by iTunes for all text fields, not
just the track name.
Am I doing something wrong? Is ‘utxt’ a new data type that should be added
to this list?
SCRIPT = <<SCRIPT
set track_name to ""
tell application "iTunes"
tell source "Library"
tell playlist "Library"
copy name of the first track to track_name
ret = OSX.do_osascript(SCRIPT)
p ret # => #<AEDesc:0x55a1c type=‘utxt’>
p ret.to_rbobj # => #<AEDesc:0x55a1c type=‘utxt’>
p ret.to_s # => “All Around The World”