Jump to content
Sign in to follow this  

Odd "With" error in retrieving info from an object

Recommended Posts


Using wmp object.

I'm using the following:

If $oPlayer1.cdromCollection.getByDriveSpecifier("E:").Playlist.Item(1).getItemInfo("Title") <> "" Then

The problem is, when the title is not available, which is what I'm looking for, the script exits and I get an error:

: ==> Object referenced outside a "With" statement.:

This error does not make sense within it self to me because it seems to state that the request it self should not work regardless of the result, but it works if the info is there. .....Am I being clear on that?

So basically it works sometimes....when the info is there, and doesn't work when the info is not.

This leads me to believe that there is another way I should be retrieving this info. Is there another way?

EDIT: Note, if I do a "Do...Until $oPlayer1.cdromCollection.getByDriveSpecifier("E:").Playlist.Item(1).getItemInfo("Title") <> " "" and the info is not there, I don't get that error, rather a "passive" object error not causing an exit, which is really odd to me. So essentially, this way works fine, but it wont work/not usable for what I'm trying to do.

Edited by Champak

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this