Splitting mdls shell results

[code] dim f as new FolderItem
dim sh as new Shell
f=GetOpenFolderItem("")

sh.Execute "mdls -name kMDItemFSLabel -name kMDItemFSName -raw " + f.ShellPath
TextArea1.Text=sh.Result[/code]

Hi guys,

I’m getting two values from a mdls shell. Is there a way to return the results with a space or endofline etc. before it’s written to the textarea?

Kuzey

according to MAN, there is a NULL char between results

so (untested)

textarea1.text=replaceall(sh.result,chrb(0),chrb(32))

you could also use split() or nthfield() to get the values.

Brilliant…Thanks guys!!

Kuzey

Pardon my ignorance if I’m missing something here. SpotlightQuery seems like it’d be the better choice as it wraps up all this functionality cleanly.

What’s the advantage to using Shell over SpotlightQuery?

SpotlightQuery searches for files & [quote]mdls – lists the metadata attributes for the specified file[/quote] taken from manual page for mdls…two different things.

The shell version of SpotlightQuery:
mdfind has the ability to limit the search to a given directory with the -onlyin option…which you can’t do with SpotlightQuery.