I’ve put together a script that processes files dropped onto it. Successfully processed files have their filename added to a list that is output to a text file at the end. I’ve been trying to get the number of filenames in the list but keep getting odd results. The script is roughly this:-
on open someitems
set donelist to {}
repeat with theitem in someitems
--process file in some way
set donelist to (donelist & filename of theitem)
end repeat
display dialog (length of donelist)
end open
Hopefully you’ll get the idea from that.
I’m not sure if it’s something to do with Applescripts text item delimiters?
on open theseItems
set doneList to {}
repeat with thisItem in theseItems
set thisName to name of (info for thisItem without size)
--process file in some way
set doneList's end to thisName
end repeat
display dialog (count doneList)
end open
I’m still getting some weird numbers. If I process 2 files ‘comments_test copy 121.pdf’ and ‘comments_test copy 122.pdf’ I get the value 70 returned, not 2, which it should be.
When I calculate the number of chars in both filenames and a header line I get something near to 70.