Friday, November 17, 2017
  • Index
  •  » Automator
  •  » Have (almost) written first automator action for iTunes

#1 2005-06-03 05:09:42 am

okohll
Member
Registered: 2005-06-02
Posts: 2

Have (almost) written first automator action for iTunes

Hi,

I've written my first applescript automator application, it extracts artwork from iTunes into individual image files.

It works! Almost :-(

The image files are created on disk but I can't work out how to pass them as output. I can't find much info on this in Apple's intro guide http://developer.apple.com/documentatio … index.html

If I specify com.apple.applescript.text-object under AMProvides in info.plist, I can output text strings. However if this is changed to public.image and use the applescript

Applescript:


set artworkData to (data of artwork 1 of itunesTrack) as picture
set end of output to artworkData

or

Applescript:


set finalartworkFile to (artworkFolder & theName & extension) as string
set end of output to finalartworkFile

it doesn't work.

When you put another action after it which accepts 'Image file', the two don't link and both 'Image file' linkers turn red. It seems likely that there's something wrong besides the applescript but I must admit this is new to me and I haven't got a clue.

Does anyone know how to do this properly?

Best regards,

Oliver Kohll

Offline

 

#2 2005-06-03 04:51:11 pm

ktam
Member
From:: UK
Registered: 2003-01-24
Posts: 246
Website

Re: Have (almost) written first automator action for iTunes

without seeing your on run handler it is a bit difficult.

From what you have written I believe you need to do the following.

You need to keep track of all the aliases or file references to the files you have created in a list, in my short applescript below I have assumed you called the variable where you have stored that info theFiles. The script below is only a guide of what you need to do. I don't know the boundary conditions for your loop.

Applescript:


set theFiles to {}
repeat
set finalartworkFile to (artworkFolder & theName & extension) as alias
set end of theFiles to finalartworkFile
end repeat
return theFiles
end run

A better value for AMProvides is something like: com.apple.applescript.alias

I don't have the documentation in front of me now so you will have to look up the list of types.

I hope that helps.


MovingImages is a scripting tool for non-linear video editing.
http://zukini.eu/movingimages

iMagine Photo is deprecated. I would not use it for any new projects.

Offline

 

#3 2005-06-03 07:28:11 pm

okohll
Member
Registered: 2005-06-02
Posts: 2

Re: Have (almost) written first automator action for iTunes

Great, thanks ktam, that's it. smile

com.apple.finder.file-or-folder-object seems to work, there may be a more appropriate one but that'll do for now.

I'll post my action to macscripter when it's finished.

Cheers

Oliver

Offline

 
  • Index
  •  » Automator
  •  » Have (almost) written first automator action for iTunes

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)