Mojave : Update folderItem in Finder

I have code which saves a file with a new icon, and want to make sure the Finder updates it propely.

  • In the old days, I used Folderitem.FinderUpdateMBS, but this is Carbon 32 bit only
  • Another way is to send an ‘fupd’ appleEvent to the finder, e.g.
#if TargetMacOS
Function UpdateInfInder(f as folderItem) as boolean
    dim ae as New AppleEvent ("fndr", "fupd", "MACS")
    if ae <> nil then
      Dim list as AppleEventDescList = New AppleEventDescList
      list.AppendFolderItem (f)
      ae.DescListParam("----") = list
      return ae.Send
  return false

But I’m worried that in Mojave this may not be allowed.

Any ideas?

Had the problem myself and with some help from the forum I got:

'update finder NSWorkspaceMBS.noteFileSystemChanged(theAttachment)


Let me change plugin and just call NSWorkspaceMBS.noteFileSystemChanged for FinderUpdateMBS method.