How Get and Set Documents ( comment )

Hi everybody
Is there a way to get end set the “comments” in the system info of a files By " folderItem " or any Xojo class
or do i have to use “kMDItemFinderComment” in shell

By the way someone can tell me what is " MDItemComment "
kMDItemComment: A comment related to the file. This comment is not displayed by the Finder
somekind of secret info that i can hide ?
Thanks
I’v just realize that i not sure if “kMDItemFinderComment” can “SET” the info

i can’t use… or don’t know how

sh.Execute "mdls -name kMDItemFinderComment -raw " + f.ShellPath

I work from a mac to target a file base on windows 2013 server

I’d expect it to not work since you’re trying to use a command meant for files on your Mac’s file system on a Windows server

yes Norman ( you’v point it out at my other post )
I’v just mentioned it to show that i’m in search for solution and not just wait for answers
I don’t understand why… its only the file is host on winserver… i’m not trying to execute the command directly from winAPI
Anyway…That return the the main question
Is there a xojo class who can add comment to file info base on win server from OSX
Thanks

how is the server mounted ?
via smb ?
it would probably require a command that SMB supports to set it IF Windows can store the information at all
It may not

it’s for a one shot deal
So i can mount in SMB or afp … if it’s matter

[quote]IF Windows can store the information at all[/quote] i don’t understand… i can see the file…i can get info… i can see the comment box… so it’s store that info…even on winserver
I even think to copy each file localy… make the process that i want to file AND run command to comment box
then return the file to the server ( Its Very very counter productive )
I dont like that solution… dig again
Thanks

Windows has a the notion of “Personal data” but it is absolutely nothing like Mac OS X comments.

You can add a comment to a Windows file medium mounted to Mac, but the minute it is moved or modified under Windows, it loses the Mac OS X comments. Likewise under Linux. If you upload a file with a comment from Mac OS X to a Windows file system or Linux file system, the comment goes pumpkin as well.

i won’t contradict you Michel
I’v just make test… even unmount and re-mount the drive
My comment is still there.

[quote=252919:@Denis Despres]i won’t contradict you Michel
I’v just make test… even unmount and re-mount the drive
My comment is still there.[/quote]

As long as you need it only on Mac, you are OK. It can be destroyed any time under the other system, though.
If you are fine with that, be happy.

thanks for precision Michel ( I will not take the chance )
OK forget the comment…the mdls command dont work anyway
I just search a way to “Mark” the file as “Processed”
leaving out the date changing… is there another check box… comment… or anything else
that native xojo class can Enable to a file base on winserver… from osx

Back up a little bit. What do you want to achieve exactly ?

Just set a mark to a file that xojo can set and get
to know if the file as been “processed” before… by my own application
I can’t check the modification date… because at the end of the processing
i replace the modification date at the date is was before…like it was never touched

I think of two solution:
1- build a database… ( i though is overkill for the pupose )
2- set comments by applescript ( in fact that is one shot deal ) i dont bother that info disapear tomorow

Both will work, the first being less fragile, unless the file gets renamed.

If indeed you need the info only during the session and don’t care it vanishes tomorrow, then indeed use the Javascript stuff.

all the processing around the files is base on the name
it will never change… in the case it’s not only my app who will not working
thanks you both Michel and Norman

[quote=252933:@Denis Despres]I think of two solution:
1- build a database… ( i though is overkill for the pupose )
2- set comments by applescript ( in fact that is one shot deal ) i dont bother that info disapear tomorow[/quote]
#1 is the more robust solution IMHO; with #2 and using the Finder’s comments, this can be removed by the user (Get Info), a Window cleanup tool which might see the hidden mac attribute as unneeded. The other consideration is that OS X’s Spotlight will index the comment, making the file searchable by the information you’re attaching as an attribute.

If you only need to know per session (that time the application is run) you can use a dictionary to store the path to the file. This is very fast.