This will probably fix your issue...
As an example, you can grab track names as shown below. The problem with your code is the CurrentSource is just a container property that only contains the selected AV input (external or internal) or nothing. The inputs are input objects that get selected as one changes an input selection on a receiver, switcher, etc...
It is to the input object that the source is bound to using the "Source" container property of the input object that's selected and not to the CurrentSource container.
sTrackName = home.Theater.AVDevices.Receiver.CurrentSource.
Source.CurrentTrack.TrackName
Also, you are trying to use getvalue to grab an object. I've never tried this, but according to the help file, this is not the intention. Use the GetObject methods to generically find objects by type, name, etc... A track is an object, not a property. A track name is a property, so sTrackName = this.CurrentSource.
Source.CurrentTrack.GetValue("TrackName") will work.
However, depending on the event that triggers your code, you should also check for the case of CurrentSource, Source and CurrentTrack containers containing nothing. Not doing this is asking for trouble and will make your code more error prone. You need to do this in a nested fashion, so an error will never be thrown.
GetValue Method Premise Scripting Reference
Returns a value on an object.
object.GetValue(Name, Value)
Arguments
object
(required)
Any PremiseObject.
Name
(required)
String with name of property.
Returned Values
Value
Variant with value of property.
Shinyshoes said:
I am attempting to get the digital track information from mp3 files to show on the display pads for my whole house audio system. When I browse in premise to the audio track, I am able to see the artist, title, album, track, genre, duration, etc. However using code:
dim oTrack
set oTrack= this.CurrentSource.GetValue("CurrentTrack")
this.Artist=oTrack.Artist
The oTrack.Artist always returns "".
however if I browse to the track, the info is there........
trackinfo.png
Any Ideas?