• 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: reference by location in iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reference by location in iTunes


  • Subject: Re: reference by location in iTunes
  • From: Romy Opena <email@hidden>
  • Date: Wed, 26 Jan 2005 09:30:59 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

Hi,

I am not sure if I understood your problem but I hope this might help
in a way.

I could do what you want to do, set the currently active track to
your variable mySong, get the played count, the played date and the
file track id.

Here's the simple iTunes script for that:

tell application "iTunes"
	activate
	play
	set mysong to the current track
	-->gives the file track id
	get played count of mysong
	-->gives the total play count in integer
        get the played date of mysong
        -->gives you the date and time the current track has been
played

....and so on.


end tell

It would be advisable to refer to the iTunes dictionary to look at
the properties and elements of any class that you can target with
your script.  For example, I did not see anything about "location"
when I checked the class: track so I can't see how your script would
work. I  might have missed it so I will check the entire dictionary
again.

Good luck.

Romeo Opena
--- Allan Hise <email@hidden> wrote:

>
> I am trying to come up with a way to update the play count and last
> played
> information in iTunes. This applescript will be executed by a perl,
> which
> will fill in the "XXX" "YYY" and "ZZZ" information, below.
>
> At this time, I am having a problem getting iTunes to understand
> which
> track I am referring to. I am attempting to use the location of the
> track
> since that is the easiest unique identifier that this perl
> application knows.
>
> Unfortunately, I couldn't find anything that was quite right on
> Doug
> Adams' excellent iTunes scripts web site, nor was a ton of googlng
> successful in helping me.
>
> Maybe there is a better way to do what I am trying to do, but,
> here's what
> I have got...  The problem is with the "set mysong" line.
>
> tell application "iTunes"
> 	--	play "XXX"	-- this works, why won't the next line
> 	set mysong to the track whose location is "XXX"
> 	tell mysong
> 		set played count to "YYY"
> 	-- even better would be to merely increment by 1
> 		set played date to "ZZZ"
> 	end tell
> end tell
>
> Any ideas?
>
> thanks!
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list
> (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>


=====
Romeo T. Opena, PhD
Managing Director/Plant Breeder
ARCH Seed (Thailand) Co., Ltd.
138 Moo 2, Tambon Samrongmai
Lahansai, Buriram
THAILAND 31170
Mobile phone: 66-1-881-2374

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: reference by location in iTunes
      • From: Allan Hise <email@hidden>
References: 
 >reference by location in iTunes (From: Allan Hise <email@hidden>)

  • Prev by Date: Re: 'include' statement in applescript
  • Next by Date: best way to get user's default language...not a list of installed languages
  • Previous by thread: Re: reference by location in iTunes
  • Next by thread: Re: reference by location in iTunes
  • Index(es):
    • Date
    • Thread