7/25/2023 0 Comments Applescript type2phone example![]() ![]() Create a new playlist named something like "Radio".I couldn't find a great way to play radio stations out of the Radio Stations playlist that ships with iTunes, but I did find a workaround. If you prefer working with iTunes playlists by number (which might be easier in a long, complicated script), you can search this way instead:ĪppleScript “radio” script: Play a radio station Set results to (every file track of playlist "Library" whose name contains "Young at Heart" and artist contains "Bennett") Here's a similar AppleScript iTunes search and play example: Set search_results to (search library playlist 1 for "Bob Seger" only artists) Or if you prefer your playlists by number, this script will work: Set search_results to (search playlist "Music" for "Bob Seger" only artists) You can then extend this iTunes search example with a "search and play" script like this: Set search_results to (search playlist "My Favorites" for "Bob Seger" only artists) Here's an AppleScript iTunes search script that searches an iTunes playlist for songs by the artist named Bob Seger: ITunes searching with AppleScript: Search and play Set current_volume to current_volume + increase takes an argument like 10 or 20 to increase the volume Set current_volume to current_volume - decreaseĪnd this opposite script can be used to increase Mac system volume from AppleScript: Set current_volume to output volume of (get volume settings) takes an argument like 10 or 20 to decrease the volume This command can be used to decrease the Mac system volume (not the iTunes volume, but this is more or less related to iTunes AppleScript scripts): Here is a short collection of AppleScript iTunes volume commands. How to play a track by number (assuming you know the number of the track and playlist you want to play): Get count of tracks of (get view of front window)ĪppleScript to get the number of tracks in an album:Ĭount (tracks of (view of front window) whose album is "Greatest Hits") I found this on another website (sorry I don't remember its name, or I would link to it, but this AppleScript script gets a count of tracks in the current playlist because "the view property returns a reference to the selected playlist": ![]() Set track_name to the name of the current track Set track_comments to the comment of the current track Set track_artist to the artist of the current track Set track_album to the album of the current track Some one-liners to get AppleScript iTunes track properties: Here is a collection of one-line AppleScript iTunes commands that can be used: ITunes tracks: Next, previous, play, pause Play track "Not Ready to Make Nice" of playlist "Dixie Chicks" Here's one way to play a particular song in an iTunes playlist with AppleScript: Play an iTunes song by name with AppleScript To get a count of the number of iTunes playlists: While I'm writing about AppleScript iTunes playlists, here is a way to get a list of the iTunes playlist names: Tell application "iTunes" to play playlist "My Top Rated" If you haven't used AppleScript much before, note that you can abbreviate that script like this: To get started, here's an AppleScript iTunes script to play an iTunes playlist: AppleScript iTunes example - Play a playlist I've been writing a lot of small AppleScript scripts, including AppleScript iTunes scripts, and I thought I'd share snippets of code from those iTunes scripts here for anyone else they might benefit.Ģ021 Update: Wherever it says “iTunes” below, substitute the word “Music”, as Apple has renamed the iTunes application to Music. ITunes AppleScript FAQ: Can you share some iTunes AppleScript examples (example scripts)?Īs I've been working a lot with Mac speech recognition software lately, AppleScript has once again become important in my life. ![]()
0 Comments
Leave a Reply. |