So, like normal… I feel like I’ve got most of the pieces to my current puzzle. But there’s one little hiccup that is hanging me up.
I have a folder full of files ” images.
I have a TextWrangler doc that lists a subset of the above files.
I want to label the images if they are on the list.
For labeling I’m using this:
set theFolder to (choose folder with prompt "Choose a Folder")
set fileNames to {"0003.png", "0005.png", "0007.png", "0009.png", "0011.png", "0013.png", "0015.png"}
tell application "Finder"
set label index of (every item whose name is in fileNames) of theFolder to 1
end tell
I was attempting to replace the string of files above with a copy-paste from TextWrangler using System Events. I’m using some grep work to get me list to look something like this:
0003.png
0005.png
0007.png
0009.png
0011.png
0013.png
0015.png
I was hoping to load the clipboard with the files names and then have the Applescript use the clipboard as the source for the list of files to treat. But this simplified version is missing something:
set fileNames to the clipboard
tell application "Finder"
set label index of (every item whose name is in fileNames) of theFolder to 1
end tell
Obviously, I’m missing something in the translation process here. From my list into the Applescript list. Any hints someone may provide would be greatly appreciated.