With absolutely no help from the applescript mailing list (grumble,
grumble), I finally figured out at least one way to applecript this in
OS X 10.3.7.
I haven't done a ton of test cases, and it really assumes that the track
is there. And there is probably a more efficient and better way to do
this, but it works. And it is relatively quick on my 20,000 track library.
I have not tried playing wit your code to have it spit out the right
applescript, this was a standalone script that I tried. Do you want to add
this to your plugin and I'll see if it does the trick? The applescript
follows, obviously the path string should be updated by your plugin, and
the date string (something like) "Saturday, January 1, 2000 12:00:00 AM"
(but I think can be sortened to "1/1/0 0:0:0")
Here is the script:
tell application "iTunes"
set lib to library playlist 1
set the_path to "mp3:Cop Shoot Cop:White Noise:11 If
Tomorrow Ever Comes.mp3"
set the_selection to current track
set current_plays to played count
set played count to current_plays + 1
-- set the_date to (current date)
-- set played date to the_date
set played date to date "Wednesday, February 2, 2005
On Mon, 17 Jan 2005, Craig, James (IT) wrote:
> Hi Allen,
> I would certainly appreciate any input to get my plugin working on the
> Mac - it seems so unfair that it doesn't work but does on Windows!
> The key to making it work is to get the appleScript to find a track in
> iTunes based on the data we know in SlimServer eg.
> Others on the list have had a look at my guess (bear in mind I know
> almost nothing about appleScript) and given up.
> Perhaps better to start from scratch!
> -----Original Message-----
> From: discuss-bounces (AT) lists (DOT) slimdevices.com
> [mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Allan Hise
> Sent: 17 January 2005 12:32
> To: discuss (AT) lists (DOT) slimdevices.com
> Subject: [slim] iTunes Update Plugin w/ OS X
> I really like the idea of my iTunes database being updated when the
> slimserver plays songs, and was disappointed to read that the iTunes
> Update plugin hasn't been tested with OS X.
> Before I take the plunge and see whether I can get it working, has
> attempted this before? Are there any pitfalls I should be aware of?
Results 1 to 1 of 1
Thread: iTunes Update Plugin w/ OS X
2005-02-02, 15:37 #1Allan HiseGuest
iTunes Update Plugin w/ OS X