Comment Spotlight
Mark Smith
mark at maseurope.net
Thu Jan 10 13:11:29 EST 2008
René, first, the applescript is not quite as simple as that, and I
think you'll have to put the comment into a Revolution variable first:
on mouseUp
repeat with i = 1 to the number of lines of fld "fldData" -- a
field that contain a list of file names
put line i of fld "fldData" into ancienNomdefichier -- old name
put the getCommentAS of me into tAScript
put "tell application" && quote & "Finder" & quote & cr into
tAScript
put "get comment of file" && quote & revMacFromUnixPath
(ancienNomdefichier) & quote & cr after tAScript
put "end tell" after tAScript
do tAScript as applescript
put the result into commentaire
put line i of fld "fldDatacodées" into nouveauNomdefichier --
new name
rename file ancienNomdefichier to nouveauNomdefichier -- don't
need "do"
put "tell application" && quote & "Finder" & quote & cr into
tAScript
put "set comment of file" && quote & revMacFromUnixPath
(nouveauNomdefichier) & quote && "to" && commentaire & cr after tAScript
put "end tell" after tAScript
do tAScript as applescript
end repeat
end mouseUp
I haven't actually tested this, but I think it should work. One more
thing is that you'll need to be using the full paths of the files.
Best,
Mark
On 10 Jan 2008, at 17:42, René Micout wrote:
> on mouseUp
> repeat with i = 1 to the number of lines of fld "fldData" -- a
> field that contain a list of file names
> put line i of fld "fldData" into ancienNomdefichier -- old name
> do "set commentaire to comment of file" &"e&
> ancienNomdefichier "e as AppleScript
> put line i of fld "fldDatacodées" into nouveauNomdefichier --
> new name
> do "rename file" &"e& ancienNomdefichier "e&& "to"
> &"e& nouveauNomdefichier "e -- that work
> do "set comment of file" &"e& nouveauNomdefichier "e&&
> "to commentaire" as AppleScript
> end repeat
> end mouseUp
More information about the use-livecode
mailing list