Finder's "info for" and ASOC

I’m porting an Automator action from AppleScript Studio to ASOC and have run into a problem.

I’ve been using this code:

            tell application "Finder"
                set theInfo to info for anItem
                set theComment to get comment of anItem
            end tell

to get the Spotlight comment of a specific file, but that doesn’t seem to work in ASOC. What should I be doing instead?



the info for line is not needed at all.
It works fine with a file specifier instead of an alias specifier

tell application "Finder"
            set theComment to comment of file (anItem as text)
        end tell

Thanks Stephan, that’s a good tip. Unfortunately, it still seems to be crashing out at that line. I don’t get an error there, the flow just stops.

could you post a bit more of code (e.g. where comes anItem from) and perhaps the error log

Actually, I got it working by doing this:

set theComment to comment of file (anItem as alias)

Thanks for your help!