4

Can anyone help me to get the active list on display in the Reminders app on OS X?

According to the applescript dictionary for reminders, the application has a "default list" property which is "the list currently active in the Reminders application."

However, this property always seems to return the first list in order in the lists sidebar, not the list which is actually being displayed and is active. I have found that if I rearrange the order of the lists in the sidebar, I will always get whichever I have made the first list, regardless of which is actually being viewed and worked with.

My application is to create a Keyboard Maestro trigger to run an AppleScript to print the list I am currently working on, but it does not appear that the Reminders app functions as is documented in its dictionary. (I have temporarily used a workaround of having the script pop up a chooser listing all the lists so I can select the one i want to print, but that's inefficient and inelegant).

Thanks!

  • could you please post the code you have thus far, that way i don't have to rewrite everything you have already written – mcgrailm Sep 30 '13 at 13:15
  • it seems this is a really bad app... i don't think it works properly to begin with let alone to manipulate with applescript – mcgrailm Sep 30 '13 at 17:06

1 Answers1

2

Yes, you can, but you will have to use the bad GUI scripting. And in a bad way. Look:

--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

This works. But only if Reminders is open. And if Apple changes Reminders structure...

idmean
  • 14,540
  • 9
  • 54
  • 83