Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 刷新徽章以在Finder中归档图标_Python_Objective C_Macos_Applescript_Overlay - Fatal编程技术网

Python 刷新徽章以在Finder中归档图标

Python 刷新徽章以在Finder中归档图标,python,objective-c,macos,applescript,overlay,Python,Objective C,Macos,Applescript,Overlay,我在OSX中完成了图标覆盖,我只需要在状态改变时更新覆盖图标。我尝试了很多技巧,但都不管用。我不需要重新启动finder,我只想更新特定文件的徽章图标 对于这个案例,我尝试了一些方法 只要触摸并删除该文件,就会触发刷新查找器 它工作得很好,但当它不处于活动状态时,它也会打开finder窗口。(我们是否可以选择不在此处打开finder窗口) 除了以上两种方法外,我还需要任何优化的方法来刷新finder中文件的徽章图标您是否找到了解决此问题的方法?我对Finder Sync也有同样的问题Ext

我在OSX中完成了图标覆盖,我只需要在状态改变时更新覆盖图标。我尝试了很多技巧,但都不管用。我不需要重新启动finder,我只想更新特定文件的徽章图标

对于这个案例,我尝试了一些方法

  • 只要触摸并删除该文件,就会触发刷新查找器

  • 它工作得很好,但当它不处于活动状态时,它也会打开finder窗口。(我们是否可以选择不在此处打开finder窗口)


  • 除了以上两种方法外,我还需要任何优化的方法来刷新finder中文件的徽章图标

    您是否找到了解决此问题的方法?我对Finder Sync也有同样的问题Extension@jigs我已经使用了以下解决方法谢谢您的回复,但它对我不起作用..:(你能详细说明你发布的脚本吗?它只是调整finder窗口的大小,这会触发finder更新其文件,因此图标会更新。是的,你是对的,它会调整finder窗口的大小,但不会刷新finder。不,它正在刷新,你正确加载finder同步扩展了吗?是的,它已经启用了。你能吗在启动上述脚本时,让我知道是否有任何finder委托方法或任何其他方法将在此时执行以刷新徽章?
    try
      tell application "Finder"
        set a to get the bounds of the front window
        set b to get the bounds of the front window
        set bound to (item 3 of a) + 1
        set item 3 of a to bound
        set bounds of the front window to a
        set bounds of the front window to b
      end tell
      return a
    on error msg number num
    --display dialog "Unable to launch " & msg & " (" & (num as text) & ")"return msg
        return msg
    end try
    
    try
      tell application "Finder"
        set a to get the bounds of the front window
        set b to get the bounds of the front window
        set bound to (item 3 of a) + 1
        set item 3 of a to bound
        set bounds of the front window to a
        set bounds of the front window to b
      end tell
      return a
    on error msg number num
    --display dialog "Unable to launch " & msg & " (" & (num as text) & ")"return msg
        return msg
    end try