A script that builds a DMG, and is supposed to change the desktop icon… (which DID work before)
let dmgVOL = "/Volumes/\(vol)"
let iconVOL = "\(dmgVOL)/.VolumeIcon.icns"
log("\t\tAdd Custom Desktop Icon \(part)",false)
//
r = execute("cp -R -P '\(custom_icon)' '\(iconVOL)'")
r = execute("SetFile -a C '\(iconVOL)'")
r = execute("SetFile -a C '\(dmgVOL)'")
If there is a period (ie. hidden) on VolumeIcon.icns it does NOT seem to copy the file ( I have macOS set to show hidden files) but the AppleScript the arranges things does not barf when it is told to set the finder location.
But if I REMOVE the “.” it DOES copy the file into the DMG, but of course then the AS does barf.
So the first method “looks” like it is working, but the desktop icon does not change
oh, and the return value (r) are blank in all cases
DO WORK…
leading me to believe that for this purpose there is no difference between CP or DITTO, but for some unknown reason is has to do with the file name
Note : if i use .stuff (dot stuff) it does WORK, and the file shows up hidden just like it should
Perchance does ‘/Volumes/myDMG/.VolumeIcon.icns’ already exist ?
Manually doing the CP doesnt show any error message ?
Just never seen cp & ditto fail silently