Hello
Some times ago I read a post saying that the osxutils package contains geticon and seticon command.
I downloaded the beast and start playing with it. Alas, I quickly discovered that the commands fail when one of the used pathnames contains accented chars.
As I know which foldername is the wrongdoer, I wrote a trick renaming temporarily the "culprit".
--[SCRIPT colle_icone_v3] (* utilise osxutils *)
on run open ((choose file) as list)
end run
on open (sel) set tname to "osxutils_slituxso" tell application "Finder" set f to (sel's item 1) as alias set d to (container of f) as alias
set dd to (container of d) as alias set {nof, nod} to {name of f, name of d} set name of d to tname (* renomme provisoirement *) end tell -- to Finder set dut to (dd as Unicode text) & tname & ":" set fut to dut & nof
do shell script "/usr/local/bin/seticon " & quoted form of POSIX path of fut & " " & quoted form of POSIX path of dut
tell application "Finder" set name of (dut as alias) to nod (* remet le vrai nom *) update d end tell
end open --[/SCRIPT]
It works but I wish to know if the anomaly is due to osxutils itself or to the Apple's API used to write it. As everybody may grab the sources from: I hope that someone will be able to look at them.
After all, I met the same problem when I was scripting "Image Events" and it is now gone (since 10.4.8).
Yvan KOENIG |