I have several scripts in my toolbar in DT3; I have given those scripts their own icons by - in Finder - doing “Get Info” from the context menu, marking the default icon for the file in the top left corner of the Info window and pasting an image in place.
When I transfer those scripts to a second Mac via a folder in iCloud Drive (automatically, using Hazel; but the same thing happens when I do this manually) they still appear to have the icon on the source device; but on all other devices I have the “naked” file without its icon. The same happens if I transfer via OneDrive, but not if I use AirDrop. So it seems the at least both iCloud Drive and OneDrive strip any icon placed as described above. I’ve tried and failed to find more information about this behaviour.
The result of this is that on my MacBook (the device I am copying to) the scripts in the toolbar have no individual icon, but instead all look the same.
Thinking out loud here…: can I use a script in the toolbar to simply call a different script? Then the scripts for the toolbar would never change or be updated, and would retain their icons. And the scripts which were called could be updated as and when, and wouldn’t need icons.
Looks like this is what I’d need…: run script ("/Users/<username>/whereever/ascript.scpt" as POSIX file)
The basic script (“call other script”) would never need to be changed/updated, and so wouldn’t require syncing across devices, thus wouldn’t lose its icon and would thus remain identifiable in the toolbar. The complex script which it calls could be updated as and when, synced across devices using Hazel and wouldn’t require an icon (which would get lost in the syncing process).
@Blanc unfortunately there doesn’t seem to be a simple “real” solution (if it would work at all).
Icons are stored in a file’s extended attribute com.apple.ResourceFork.
With iCloud there’s no way of preserving com.apple.ResourceFork (and I didn’t find a sync provider that preserves it):
One major type of xattr appears always to be stripped across iCloud: com.apple.ResourceFork. This is the modern xattr equivalent of the Mac’s traditional ‘resource fork’, and appears invariably to be stripped even if its name is suffixed with #S.
File Sharing does preserve com.apple.ResourceFork.
When copying files across networks, provided that both file systems support xattrs (or know how to handle them) and the protocol used is good (SMB and AFP, for instance), then all xattrs should be transferred faithfully. That’s the case when using file sharing in macOS, and it even works nicely over AirDrop.
Dear Pete, thank you so much for looking into this for me and coming back with such detail! I had searched myself, but not used clever words like attribute or xattr; in the day, icons just used to be icons So you’ve expanded my knowledge
The solution I came up with (not syncing the scripts in the Toolbar folder at all, and only placing single-line scripts calling scripts in a different - synced - folder in the Toolbar) works perfectly for me, so I haven’t looked into symlinking. Only being able to edit on one Mac would be quite a downside - I’m not very good at scripting and like to play with ideas as and when they come to me - all other things permitting, that is
Thanks again - I enjoy learning and your input in this forum is always appreciated; thank you for sharing your spare time with others in this fashion.
I wouldn’t. But it isn’t. I like to tweak my scripts all the time, making them better of course. But as I said, the problem is solved by having a script which doesn’t ever need to be changed - and therefore keeps its icon - referring to a script which can be changed willy-nilly and doesn’t need an icon, because it isn’t itself represented in the toolbar