【问题标题】:How can I add OSX Finder folder background color/image from Objective-C?如何从 Objective-C 添加 OSX Finder 文件夹背景颜色/图像?
【发布时间】:2015-10-20 14:24:09
【问题描述】:

显然有一个applescript 允许更改查找器窗口的背景颜色。我可以调用任何objective-c API来更改颜色和/或设置与路径相关的Finder文件夹以显示特定背景图像吗?我想创建一个git hook,它在特定分支上将目录的 finder 文件夹更改为红色(为了直观地显示我不应该对该分支进行更改)。

【问题讨论】:

    标签: objective-c macos finder


    【解决方案1】:

    在这里,我找到了如何更改所选文件夹中的所有查找器窗口,在这里使用它:

    tell application "Finder"
    set ChosenFolder to (choose folder)
    set TheseFolders to (every folder of entire contents of ChosenFolder)
    repeat with CounterA from 1 to (count of TheseFolders)
        set background color of icon view options of window of item CounterA of TheseFolders to (choose color)
    end repeat
    end tell
    

    希望这有帮助!

    【讨论】:

      【解决方案2】:

      很抱歉,我只知道如何在 Applescript 中进行操作:

      有图片

      tell application "Finder" to set the desktop picture to (choose file of type "png")
      

      这是使用纯色的方法

      tell application "Finder" to set the desktop picture to "Library:Desktop Pictures:Solid Colors:(Color Name)"
      

      颜色名称列表:

      1. “纯水蓝.png”
      2. “纯水深蓝.png”
      3. “固体 Aqua Graphite.png”
      4. “纯灰色 Dark.png”
      5. “纯灰色 Light.png”
      6. “纯灰色 Medium.png”
      7. “纯灰色 Pro Dark.png”
      8. “Solid Gray Pro Ultra Dark.png”
      9. “实心海带.png”
      10. “固体薰衣草.png”
      11. “纯薄荷.png”
      12. “纯白.png”

      【讨论】:

      • 谢谢,但这不是关于更改桌面壁纸图片的问题,这是众所周知的。我正在寻找有关更改不是桌面的单个查找器文件夹/窗口的信息,例如 ~/Library。
      • 哦,抱歉,我不知道,但我会尽力为您找到它
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-02-28
      • 2019-01-19
      • 2017-04-24
      • 1970-01-01
      • 1970-01-01
      • 2016-08-09
      相关资源
      最近更新 更多