Search Results

Search found 3 results on 1 pages for 'demonslayer319'.

Page 1/1 | 1 

  • How would I write the following applescript in Obj-C AppScript? ASTranslate was of no help =(

    - by demonslayer319
    The translation tool isn't able to translate this working code. I copied it out of a working script. set pathToTemp to (POSIX path of ((path to desktop) as string)) -- change jpg to pict tell application "Image Events" try launch set albumArt to open file (pathToTemp & "albumart.jpg") save albumArt as PICT in file (pathToTemp & "albumart.pict") --the first 512 bytes are the PICT header, so it reads from byte 513 --this is to allow the image to be added to an iTunes track later. set albumArt to (read file (pathToTemp & "albumart.pict") from 513 as picture) close end try end tell The code is taking a jpg image, converting it to a PICT file, and then reading the file minus the header (the first 512 bytes). Later in the script, albumArt will be added to an iTunes track. I tried translating the code (minus the comments), but ASTranslate froze for a good 2 minutes before giving me this: Untranslated event 'earsffdr' #import "IEGlue/IEGlue.h" IEApplication *imageEvents = [IEApplication applicationWithName: @"Image Events"]; IELaunchCommand *cmd = [[imageEvents launch] ignoreReply]; id result = [cmd send]; #import "IEGlue/IEGlue.h" IEApplication *imageEvents = [IEApplication applicationWithName: @"Image Events"]; IEReference *ref = [[imageEvents files] byName: @"/Users/Doom/Desktop/albumart.jpg"]; id result = [[ref open] send]; #import "IEGlue/IEGlue.h" IEApplication *imageEvents = [IEApplication applicationWithName: @"Image Events"]; IEReference *ref = [[imageEvents images] byName: @"albumart.jpg"]; IESaveCommand *cmd = [[[ref save] in: [[imageEvents files] byName: @"/Users/Doom/Desktop/albumart.pict"]] as: [IEConstant PICT]]; id result = [cmd send]; 'crdwrread' Traceback (most recent call last): File "objcrenderer.pyc", line 283, in renderCommand KeyError: 'crdwrread' 'cascrgdut' Traceback (most recent call last): File "objcrenderer.pyc", line 283, in renderCommand KeyError: 'cascrgdut' 'crdwrread' Traceback (most recent call last): File "objcrenderer.pyc", line 283, in renderCommand KeyError: 'crdwrread' Untranslated event 'rdwrread' OK I have no clue how to make sense of this. Thanks for any and all help!

    Read the article

  • How do I add artwork to an iTunes track with obj-c AppleScript?

    - by demonslayer319
    aTrack is an ITReference* object, value is an NSImage* object, initialized via a URL to a jpeg. [[[[[aTrack artworks] data_] set] to:value] send]; I get the following message in GDB: 2010-03-09 16:59:42.860 Sandbox[2260:a0f] Can't pack object of class NSImage (unsupported type): <NSImage 0x10054a440 Size={0, 0} Reps=( I then tried the following code: NSData *imageData = [[NSData alloc] initWithData:[value TIFFRepresentation]]; [[[[[aTrack artworks] data_] set] to:imageData] send]; and get this message instead 2010-03-09 16:46:09.341 Sandbox[2193:a0f] Can't pack object of class NSConcreteData (unsupported type): <4d4d002a 00000000> In the AppleScript documentation, it says that the "data" property of the "artwork" item is a PICTPicture image. How do I convert an NSImage to a PICT? Am I using the AppleScript all wrong?

    Read the article

  • How do I add artwork to an iTunes track with obj-c AppScript?

    - by demonslayer319
    aTrack is an ITReference* object, value is an NSImage* object, initialized via a URL to a jpeg. [[[[[aTrack artworks] data_] set] to:value] send]; I get the following message in GDB: 2010-03-09 16:59:42.860 Sandbox[2260:a0f] Can't pack object of class NSImage (unsupported type): <NSImage 0x10054a440 Size={0, 0} Reps=( I then tried the following code: NSData *imageData = [[NSData alloc] initWithData:[value TIFFRepresentation]]; [[[[[aTrack artworks] data_] set] to:imageData] send]; and get this message instead 2010-03-09 16:46:09.341 Sandbox[2193:a0f] Can't pack object of class NSConcreteData (unsupported type): <4d4d002a 00000000> In the AppScript documentation, it says that the "data" property of the "artwork" item is a PICTPicture image. How do I convert an NSImage to a PICT? Am I using the AppScript all wrong?

    Read the article

1