4

谁能帮我在 OS X 的提醒应用程序中显示活动列表?

根据用于提醒的applescript 字典,该应用程序有一个“默认列表”属性,即“提醒应用程序中当前活动的列表”。

但是,此属性似乎总是​​在列表侧边栏中按顺序返回第一个列表,而不是实际显示且处于活动状态的列表。我发现,如果我重新排列侧边栏中列表的顺序,我将始终得到我创建的第一个列表,而不管实际正在查看和使用哪个列表。

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

谢谢!

4

1 回答 1

2

是的,你可以,但你将不得不使用糟糕的 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

这行得通。但前提是提醒是打开的。如果苹果改变提醒结构......

于 2013-09-30T17:30:36.353 回答