gpt4 book ai didi

AppleScript 获取提醒中的事件列表?

转载 作者:行者123 更新时间:2023-12-03 10:02:54 26 4
gpt4 key购买 nike

任何人都可以帮助我在 OS X 上的提醒应用程序中显示事件列表吗?

根据提醒的applescript 字典,该应用程序具有“默认列表”属性,即“提醒应用程序中当前事件的列表”。

但是,此属性似乎总是​​按列表侧栏中的顺序返回第一个列表,而不是实际显示并处于事件状态的列表。我发现如果我重新排列侧边栏中列表的顺序,我总是会得到我制作第一个列表的任何一个,而不管实际上正在查看和使用哪个。

我的应用程序是创建一个键盘大师触发器来运行 AppleScript 来打印我目前正在处理的列表,但提醒应用程序的功能似乎不像其字典中记录的那样。 (我暂时使用了一种解决方法,让脚本弹出一个列出所有列表的选择器,这样我就可以选择我想要打印的列表,但这是低效和不优雅的)。

谢谢!

最佳答案

是的,您可以,但是您将不得不使用糟糕的 GUI 脚本。并且以一种糟糕的方式。看:

--Do some GUI scripting to get the decription of a specific group
tell application "Reminders" to activate
tell application "System Events"
tell process "Reminders"
tell window "Reminders"
tell splitter group 1
tell group 1
set des to get description
end tell
end tell
end tell
end tell
end tell

--This description is in the format "Viewing MyList, 1 reminder" so get the part to the "," from des.
set text item delimiters to ","
set texitems to text items of des
set firstPart to get text item 1 of texitems

--Setting the delimiters back
set text item delimiters to ""

--Jump to charcter 9 of firstPart then converting to text
set listname to characters 9 thru end of firstPart as text

--Now we know the name of the current list, so do whatever you want:
tell application "Reminders" to get list listname

这有效。但前提是提醒处于打开状态。如果 Apple 更改提醒结构...

关于AppleScript 获取提醒中的事件列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19095052/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com