nitro_reader
The community/apps/nitro_reader
directory contains files that provide support for interacting with the Nitro Reader 5 application using Talon.
The core functionality is split between two files: nitro_reader_5.talon
and nitro_reader_5.py
.
nitro_reader_5.talon
is a Talon file that defines the application tag. This file is responsible for activating the user.pages
and user.tabs
tags when the Nitro Reader 5 application is active.
app: nitro_reader_five
-
# Set tags
tag(): user.pages
tag(): user.tabs
nitro_reader_5.py
is a Python file that defines the application definition and actions.
The module defines the nitro_reader_five
app using a combination of matching on the application name "Nitro Reader 5" and the executable name nitropdfreader.exe
.
mod.apps.nitro_reader_five = """
os: windows
and app.name: Nitro Reader 5
os: windows
and app.exe: /^nitropdfreader\.exe$/i
"""
A context is created that matches when the nitro_reader_five
app is active.
ctx.matches = """
app: nitro_reader_five
"""
The file also defines actions within the app
and user
action classes. The app
actions include:
* tab_open()
which simulates ctrl-shift-o
, opening a new tab.
The user
actions include the following functions that implement page navigation:
* page_next()
which simulates the right
arrow key for next page.
* page_previous()
which simulates the left
arrow key for previous page.
* page_jump(number: int)
which simulates ctrl-g
to bring up the "go to page" dialog, inserts the target page number, and then simulates enter alt:2
to activate it.
* page_final()
which simulates the end
key to go to the last page.