-- great for exporting a playlist from Swinsian to another music playing software, while keeping the order of the playlist. |
-- to install: open Script Editor.app, paste this, go File > Export, choose File Format: application, save anywhere you like. |
-- to use: select tracks to export in Swinsian, then run the app you just saved. |
-- note: doesn't handle those files already existing in selected folder. pads for two-digits, adds artist - title.ext |
settheFoldertochoose folder |
settext item delimitersto'.' |
tellapplication'Swinsian' |
setselectedto selection of window 1 |
-- check that the playlist is not empty |
if selected is not {} then |
-- find out how many items in the playlist |
setctocountof selected's items |
-- then export tracks |
repeatwithifrom1to c |
settrktoPOSIX file (location of (item i of selected)) asalias |
settrknametonameof (item i of selected) |
settrkartistto artist of (item i of selected) |
tellapplication'Finder' |
setthisFileto trk |
setnewFileto duplicate thisFile to theFolder |
settitotextitemsof (getnameof thisFile) |
setipadto i astext |
ifthelengthof ipad is1then |
setipadto'0'& i |
else |
setipadto i |
end if |
ifnumberof ti is1then |
setnewNameto ipad &''& trkartist &' - '& trkname &' |
else |
setnewNameto ipad &''& trkartist &' - '& trkname &'.'&item-1of ti |
end if |
setnameof newFile to newName |
end tell |
end repeat |
end if |
end tell |