Re: iTunes Playlist
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