• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting Bridge question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Bridge question


  • Subject: Re: Scripting Bridge question
  • From: email@hidden
  • Date: Thu, 15 Nov 2007 10:49:38 +0100

No, "current" is an iTunesTrack object. [current data] return a
compilation error. "artwork" is an iTunesArtwork object. It has no
-data method. Assuming you meant [artwork data], that would equal
[[[current artworks] objectAtIndex:0] data] which results in an
uncaught exception, even though it looks like the equivalent to the
-data method of the NSAppleScript way to me:

[[[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"
to return data of artwork
1 of current track"]  executeAndReturnError:nil] data]

Thanks.

On Nov 15, 2007 3:50 AM, Chris Campbell <email@hidden> wrote:
> On Nov 14, 2007, at 9:26 PM, email@hidden wrote:
>
> > I think the problem is iTunesArtwork is not NSData, but an NSImage:
> >
> > @property (copy) NSImage *data;  // data for this artwork, in the form
> > of a picture
> >
> > How can I read this picture as data, in order to create an NSImage
> > imageWithData? I tried with  [[[current artworks] objectAtIndex:0]
> > data] and [myImageView setImage:(NSImage *)artwork] to no avail.
>
> If your original assumption is correct, then "current" is an
> ITunesArtwork object, and it has a -data method that returns an NSImage.
>
> So do something like:
>
>      [myImageView setImage:[current data]];
>
> Have fun!
>
> - Chris
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Scripting Bridge question
      • From: Andrew Kimpton <email@hidden>
References: 
 >Scripting Bridge question (From: email@hidden)

  • Prev by Date: Re: Having trouble just displaying a window
  • Next by Date: draggingUpdated: event is not called on overlay window.
  • Previous by thread: Scripting Bridge question
  • Next by thread: Re: Scripting Bridge question
  • Index(es):
    • Date
    • Thread