• 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
Weird iTunes scripting problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird iTunes scripting problem


  • Subject: Weird iTunes scripting problem
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 28 Jan 2009 20:51:03 -0700

I stripped out the parts of the code that are irrelevant to the problem.  Here is what is left:

set the outputFile to (choose file name with prompt "Choose where to save the file" default name "iTunes playlists.txt" default location (path to desktop))
set excludedPlaylists to {"Library", "TV Shows", "Music", "Movies", "Podcasts", "Purchased", "Genius", "Music Videos", "My Top Rated", "Recently Played", "Top 25 Most Played"}
set theList to {}
tell application "iTunes"
repeat with i from 1 to count of user playlists
if the name of playlist i is not in excludedPlaylists then
copy return to the end of theList
copy i to the end of theList
end if
end repeat
end tell
set fref to open for access outputFile with write permission
write (items 2 through end of theList as text) to fref
close access fref

Here is the result:

11
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

Track 11 should not be there, and track 12 should.  The name of track 11 is Top 25 Most Played, which is in the exclusion list.

What is going wrong?

-- Michelle

-- 
ASCII stupid question, get a stupid ANSI.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Weird iTunes scripting problem
      • From: "email@hidden" <email@hidden>
    • Solved: Weird iTunes scripting problem
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Automatic update by Email on Hard Disk percentage full
  • Next by Date: Solved: Weird iTunes scripting problem
  • Previous by thread: Help scripting fax setting in System Preferences
  • Next by thread: Solved: Weird iTunes scripting problem
  • Index(es):
    • Date
    • Thread