UI Interaction
IntroductionInteracts with the Wunderlist UI for reading and modifying data. GroupsAccessing Data in WunderlistGroup members:
Application InteractionsGroup members:
Navigating WunderlistGroup members:
Functions
activatePreviousApplicationActivates the original activateWunderlistCauses Wunderlist to become the active application. on activateWunderlist() assignWunderlistToAllDesktopsUses the Dock.app menu to make Wunderlist visible on all desktops, which is necessary for the list info to load reliably. Deprecated in version 0.2 focusInboxMoves focus within the app to the Inbox list. on focusInbox() DiscussionUses the keyboard to move focus within the app to the Inbox list. The Inbox list is a good reference point because it is always at the top of the lists table. The procedure for accessing the Inbox from any point in the app is as follows:
focusListAtIndexMoves focus within the app to the specified list. on focusListAtIndex( listIndex) ParametersDiscussionAfter calling focusInbox as a reference, simply use the arrow keys to move focus to the desired list. The procedure for focusing a specific list is as follows:
focusPreviousListReturns focus to the last list viewed prior to navigating lists. on focusPreviousList() DiscussionConveniently, Wunderlist goes back to the previously viewed task when the search term is cleared. This means that we can call focusInbox or even focusListAtIndex, add tasks, and then go return Wunderlist to its original view state. The procedure for returning to the previous list is as follows:
focusTaskInputSwitches keyboard focus to the task input field. on focusTaskInput() DiscussionIn certain views it is necessary to use the New Task shortcut twice because the first time switches the UI to the Inbox list. The procedure for returning to the previous list is as follows:
getIndexOfListNamedFinds the index of the specified list in the list table on getIndexOfListNamed( theListName) ParametersReturn ValueThe integer index or DiscussionReturns a one-based index of the list with the specified name,
or getListInfoLoads some basic information about all of the visible lists in Wunderlist. on getListInfo() Return ValueA list of records in the DiscussionWunderlist exposes a small amount of information about the lists that can be retrieved by traversing the UI. This information includes the name of each list, its number of tasks. Unfortunately, the number of tasks returned is undefined when there are no tasks in a list. Wunderlist does not set the value of the task count label to zero, nor does it hide the label in a way that is detectable by AppleScript. The value in the label appears to change in an undefined way, so unfortunately at this time the task count is unreliable. The list info is cached as specified by listCacheInSeconds to optimize repetitive access of the list, as with an Alfred Script Filter. The keys
getListInfoForActiveListLoads information about the currently selected list in Wunderlist. Return ValueA records in the DiscussionThe active list is highlighted in the Wunderlist UI, but finding it with UI traversal is not straightforward. In order to find which list is selected, the Rename Selected List menu option is required. It creates an editable text element that is easy to isolate with AppleScript. From the text element the name of the list can be retrieved. This allows the proper result from getListInfo to be returned. See getTaskInfoForFocusedListLoads info about the tasks in the currently visible task list Return ValueA list of records in the DiscussionLoads some basic information about all of the items in the visible list in Wunderlist. Unfortunately, due to limitations in the GUI access used to load task info, this will only include tasks that are visible in the window.
invalidateListInfoCacheEnsures that the next time the list info is requested, it will be reloaded from the UI rather than the cache. setWindowViewNormalSwitches to the "Normal" view in Wunderlist where both the list and tasks are visible. on setWindowViewNormal() |