• 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: iTunes Playlist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes Playlist


  • Subject: Re: iTunes Playlist
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 15 Jun 2018 21:49:09 +1000

On 15 Jun 2018, at 8:50 pm, Alastair Leith <email@hidden> wrote:
>
> I’ve come back to this code you sent, the last line has a typo I think
>
> bStr’s writeToFile:aTargLoc atomically:true encoding:(current application's
> NSUTF8StringEncoding) |error|:(missing value)
>
> All the other lines compile okay, but without this line I can’t run the code.

That should compile OK, but you can also simplify Takaaki's code a bit:

use framework "Foundation"
use scripting additions

set nextTrack to "next track name"
set curPlayList to "current playlist name"

set aList to {nextTrackName:nextTrack, curPlayListName:curPlayList}

set anArray to current application's NSArray's arrayWithObject:aList
set pListData to current application's NSPropertyListSerialization's
dataFromPropertyList:anArray |format|:(current application's
NSPropertyListXMLFormat_v1_0) errorDescription:(missing value)

set aTargLoc to POSIX path of (choose file name)
pListData's writeToFile:aTargLoc atomically:true

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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: iTunes Playlist
      • From: Alastair Leith <email@hidden>
References: 
 >iTunes Playlist (From: Alastair Leith <email@hidden>)
 >Re: iTunes Playlist (From: Takaaki Naganoya <email@hidden>)
 >Re: iTunes Playlist (From: Alastair Leith <email@hidden>)
 >Re: iTunes Playlist (From: Takaaki Naganoya <email@hidden>)
 >Re: iTunes Playlist (From: Alastair Leith <email@hidden>)

  • Prev by Date: Re: iTunes Playlist
  • Next by Date: [ANN] calcLibAS v1.3
  • Previous by thread: Re: iTunes Playlist
  • Next by thread: Re: iTunes Playlist
  • Index(es):
    • Date
    • Thread