Search Results

Search found 6 results on 1 pages for 'appscript'.

Page 1/1 | 1 

  • appscript on OSX 10.6.3 / Python 2.6.1

    - by jldupont
    I am having some trouble getting appscript installed on OS/X 10.6.3 / Python 2.6.1. When I issue sudo easy_install appscript I get "unable to execute gcc-4.2: No such file or directory". Even when I do export CC=/Developer/usr/bin/gcc-4.2 (a valid gcc-4.2 executable), easy_install barks. What could be the issue? Disclaimer: OS/X newbie at the helm...

    Read the article

  • Appscript to write iTunes artwork

    - by Kartik Aiyer
    I'm trying to capture artwork from a pict file and embed into a track on iTunes using python appscript. I did something like this: imFile = open('/Users/kartikaiyer/temp.pict','r') data = imFile.read() it = app('iTunes') sel = it.current_track.get() sel.artworks[0].data_.set(data[513:]) I get an error OSERROR: -1731 MESSAGE: Unknown object Similar applescript code looks like this: tell application "iTunes" set the_artwork to read (POSIX file "/Users/kartikaiyer/temp.pict") from 513 as picture set data of artwork 1 of current track to the_artwork end tell I tried using ASTranslate but it never instantiates 'the_artwork' and then throws an error when there is a reference to the_artwork. Can anyone help. I'm new to appscript and python in general.

    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

  • 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

  • iTunes Apple Events API

    - by jldupont
    I'd like to control iTunes through Objective-C ( I just can't get Python appscript installed correctly on my OS/X 10.6.3 system ... that would have been my first choice ). From what I gather, the IPC on Cocoa is based on Apple Events : is there either: Online documentation on iTunes / Apple Events API ? Instrospection mechanism to get to iTunes API? I know about Applescript Editor / Open Dictionary functionality but I can't figure out how to translate the information I see into IPC calls. Note: I have already tried working out a solution through PyObjC but the main function I am after is track searching which I can't figure out. Disclaimer: OS/X super-newbie here.

    Read the article

  • Snow Leopard upgrade -> reinstalling sqlite3-ruby gem problem

    - by Carl Tessler
    Hi all, I got ruby 1.8.7 (native compiled), rails 2.3.4, OSX 10.6.2 and also sqlite3-ruby. The error I'm getting when accessing the rails app is NameError: uninitialized constant SQLite3::Driver::Native::Driver::API History: I upgraded to snow leopard by migrating my apps with a FW-cable from my old macbook to the new one. Everything was running perfectly for months, but Yesterday I needed to install watir, which was dependant on rb-appscript, which didn't build due a "wrong architecture" error in libsqlite3.dylib. I figured the build was made on the old machine, so i wanted to rebuild sqlite3-ruby: $ sudo gem uninstall sqlite3-ruby $ sudo gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb checking for fdatasync() in -lrt... no checking for sqlite3.h... yes checking for sqlite3_open() in -lsqlite3... no * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. It seems like the sqlite3 libs are not working properly. I've tried to install macports sqlite3 (sudo port install sqlite3) and use that instead, but with same result... so i rebuild sqlite3 from scratch.. download-configure-make-make install. After that, the gem now builds perfectly, but doesn't work in rails, giving the error in the top of this article. I'm not really sure where to go from here because I've tried the following Rebuild sqlite3 from newest source (http://www.sqlite.org/download.html) Reinstalled sqlite3-ruby (sudo gem uninstall sqlite3-ruby && sudo gem install sqlite3-ruby) Used sqlite3 from macports (sudo port install sqlite3 && sudo gem install sqlite3-ruby) Reinstalled rails (sudo gem install rails sqlite3-ruby ) and updated environment.rb to rails 2.3.5. No avail, I still get this error: NameError: uninitialized constant SQLite3::Driver::Native::Driver::AP from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in const_missing' from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/driver/native/driver.rb:76:in open' from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/database.rb:76:in `initialize' Btw, I have Xcode installed from the Snow Leopard CD. What can i do to solve the problem?

    Read the article

1