Saturday, January 16, 2021

#1 2021-01-12 11:55:43 am

daBee
Member
From:: Toronto
Registered: 2010-02-09
Posts: 156

File Name of iTunes Track

Hi folks.  Anybody know how to get the filename of a track in a playlist? 

I tried getting the location of it and splitting on ":", but that didn't work. 

Applescript:

tell application "iTunes"
   set myplaylist to "tunes_test"
   set TrackLocations to location of every file track of playlist myplaylist
   set myt to the first item in TrackLocations as text

   set oldDelimiters to AppleScript's text item delimiters
   set AppleScript's text item delimiters to ":"
   set wordlist to text items of myt as text
   set AppleScript's text item delimiters to oldDelimiters
   log wordlist
   -- set wordlist to tokenize the first item in TrackLocations with delimiters {":"}

end tell

I'm repairing a script and I can't seem to build a shell script that uses both the current source path and the target modified path.  I replace the latter with some characters omitted. 

Any insight appreciated.  Cheers


Filed under: iTunes, filename

Offline

 

#2 2021-01-12 12:07:48 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11714
Website

Re: File Name of iTunes Track

The line

Applescript:

set wordlist to text items of myt as text

splits the text and joins it at once because of the as text coercion. Delete it

Applescript:

set wordlist to text items of myt

The file name is the last text item


regards

Stefan

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)