获取桌面图标的位置?

发布于 2024-10-04 05:58:51 字数 120 浏览 6 评论 0原文

有没有办法获取 Snow Leopard 中桌面图标的位置?我相信 Leopard 中的每个图标都是不同的窗口,但这种情况在 SL 中发生了变化。

是否有 API 可以执行此操作或有文件(如配置文件)可以解析?

Is there a way to get the locations of the desktop icons in Snow Leopard? I believe each icon was a different window in Leopard, but this changed with SL.

Is there an API to do this or a file (like a configuration file) to parse?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

澜川若宁 2024-10-11 05:58:51

据我所知,桌面上的图标似乎是“AXImage”。如果您退出辅助功能检查器(在/Applications/Utilities/辅助功能工具/中),您可以检查屏幕上项目报告的辅助功能信息。

例如:

<AXApplication: "Finder">
 <AXScrollArea: "desktop">
  <AXGroup: "._sideEntrance.psd">
   <AXImage: "Untitled.icns">

Attributes:
   AXRole:  "AXImage"
   AXRoleDescription:  "image"
   AXParent:  "<AXGroup: "._sideEntrance.psd">"
   AXWindow:  "<AXScrollArea: "desktop">"
   AXTopLevelUIElement:  "<AXScrollArea: "desktop">"
   AXSize:  "w=16 h=16"
   AXPosition:  "x=106 y=412"
   AXEnabled:  "true"
   AXFocused (W):  "false"
   AXTitle:  "Untitled.icns"
   AXFilename:  "Untitled.icns"
   AXURL:  "file://localhost/Users/mdouma46/Desktop/Untitled.icns"
   AXSelected (W):  "false"
   AXEnabled:  "true"

Accessibility API(无论如何,较低级别的 API)是 HIServices 的一部分:

/System/Library/Frameworks/ApplicationServices.framework

/.../HIServices.framework(您链接 ApplicationServices 伞形框架并将其导入到您的然而,项目)。

我对这些 API 不太熟悉,因此无法提供具体信息,但这将是一个起点。

希望这有帮助...

As far as I can tell, icons on the Desktop appear to be an "AXImage". If you get out Accessibility Inspector (in /Applications/Utilities/Accessibility Tools/), you can examine the Accessibility information reported for items on the screen.

For example:

<AXApplication: "Finder">
 <AXScrollArea: "desktop">
  <AXGroup: "._sideEntrance.psd">
   <AXImage: "Untitled.icns">

Attributes:
   AXRole:  "AXImage"
   AXRoleDescription:  "image"
   AXParent:  "<AXGroup: "._sideEntrance.psd">"
   AXWindow:  "<AXScrollArea: "desktop">"
   AXTopLevelUIElement:  "<AXScrollArea: "desktop">"
   AXSize:  "w=16 h=16"
   AXPosition:  "x=106 y=412"
   AXEnabled:  "true"
   AXFocused (W):  "false"
   AXTitle:  "Untitled.icns"
   AXFilename:  "Untitled.icns"
   AXURL:  "file://localhost/Users/mdouma46/Desktop/Untitled.icns"
   AXSelected (W):  "false"
   AXEnabled:  "true"

The Accessibility APIs (the lower level ones, anyway), are part of HIServices:

/System/Library/Frameworks/ApplicationServices.framework/.../HIServices.framework

(You link against and import the ApplicationServices umbrella framework into your project, however).

I'm not that familiar with those APIs so I can't offer specifics, but that would be a place to start.

Hope this helps...

心不设防 2024-10-11 05:58:51

文件和文件夹图标的位置位于 .DS_Store 文件中,该文件存在于任何目录(Finder 已查看过的)

Position of files and folders icons is in the .DS_Store file, this exists for any directory (that Finder has viewed)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文