I am trying to write an apple script that sequentially names my TV shows with "S0XEYY" where YY is a two digit number. I have the following:
tell application "iTunes"
set p to selection
set c to count of p's items
set fixed indexing to true
repeat with i from 1 to c
set t to item i of p
try
set the episode number of t to i
set the episode ID of t to "S" & (text returned of a) & "E" & i
set the season number of t to text returned of a
end try
end repeat
However, I need the
(text returned of a)
as well as
i
to be of width 2, padded with a 0. How do I go about doing this?