Applescript and iTunes

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Applescript and iTunes

Post by Mag »

I'm using this script to get the list of iTunes playlists:

Code: Select all

    tell application "iTunes"
        get name of playlists
    end tell
Unfortunately it returns also the names of the "standard" playlist (as "Library", "Music", Movies", TV Shows", "Podcasts", "iTunes U", "Audiobooks", "Purchased").

Is there a known way to remove this items from the list? I could do it with a replace command but I guess that it don't work in non-English localized systems.

:roll:
Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: Applescript and iTunes

Post by Zryip TheSlug »

Hi Mag,

Did you try?

Code: Select all

tell application "iTunes"
	get name of playlists whose special kind is none
end tell


Best,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Applescript and iTunes

Post by Mag »

Thank you Zryp.

I get a compiler error :(
Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: Applescript and iTunes

Post by Zryip TheSlug »

Hi Mag,
I get a compiler error :(
The script is working here.

Could we check the result inside the applescript editor before to execute it with LC?

Open the Applescript script editor and copy paste the script, then run it by clicking the green button. What is the result?



Best Regards,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Applescript and iTunes

Post by Mag »

Oops, sorry, you're right. I inserted an error in the script, now I corrected it and your code works fine. Thank you!
Post Reply