Dictionary Module Reference
New in version 0.0.2.
Control the macOS Dictionary application using JXA-like syntax.
Functions:
|
CFStringRef DCSCopyTextDefinition(DCSDictionaryRef arg0, CFStringRef arg1, CoreFoundation.CFRange arg2); |
Classes:
|
A class for managing and interacting with Dictionary.app. |
- PyXA.apps.Dictionary.DCSCopyTextDefinition(arg0, arg1, arg2, /)
CFStringRef DCSCopyTextDefinition(DCSDictionaryRef arg0, CFStringRef arg1, CoreFoundation.CFRange arg2);
- class PyXA.apps.Dictionary.XADictionaryApplication(properties)[source]
Bases:
XAApplication
A class for managing and interacting with Dictionary.app.
See also
XADictionaryDefinition
New in version 0.0.2.
Methods:
define
(word)Gets the definition of a word in raw text form.
Toggles fullscreen for the current Dictionary window.
go_back
()Goes to the previous page/definition.
Goes to the next page/definition.
new_tab
()Opens a new Dictionary tab.
Opens a new Dictionary window.
Opens the "About Dictionary" panel.
Opens the folder containing custom/downloaded dictionaries.
Opens the preferences window for the Dictionary application.
paste
()Pastes the current contents of the clipboard into the selected item, if there is one.
print
()Opens the dictionary app's print dialog.
search
(term)Searches the currently selected dictionary.
search_all
(term)Searches the provided term in all dictionaries
search_apple_dictionary
(term)Searches the provided term in the Apple Dictionary
search_new_oxford
(term)Searches the provided term in the New Oxford American Dictionary
search_oxford_thesaurus
(term)Searches the provided term in the Oxford American Writer's Thesaurus
search_wikipedia
(term)Searches the provided term in Wikipedia
Displays the help window for Dictionary.app.
Begins dictation to fill the selected item, if there is one.
Switches to searching all installed dictionaries.
Switches to searching the Apple Dictionary.
Switches to searching the New Oxford American Dictionary.
Switches to searching the Oxford American Writer's Thesaurus.
Switches to searching Wikipedia.
Displays the front/back matter of the selected dictionary.
- define(word: str) str [source]
Gets the definition of a word in raw text form.
- Parameters:
word (str) – The word to define
- Returns:
The definition of the word
- Return type:
str
New in version 0.0.2.
- open_about_panel()[source]
Opens the “About Dictionary” panel. Mimics clicking File->About Dictionary.
New in version 0.0.2.
- open_dictionaries_folder()[source]
Opens the folder containing custom/downloaded dictionaries.
New in version 0.0.2.
- open_preferences()[source]
Opens the preferences window for the Dictionary application. Mimics clicking File->Preferences…
New in version 0.0.2.
- paste()[source]
Pastes the current contents of the clipboard into the selected item, if there is one.
New in version 0.0.2.
- search(term: str)[source]
Searches the currently selected dictionary.
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- search_all(term: str)[source]
Searches the provided term in all dictionaries
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- search_apple_dictionary(term: str)[source]
Searches the provided term in the Apple Dictionary
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- search_new_oxford(term: str)[source]
Searches the provided term in the New Oxford American Dictionary
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- search_oxford_thesaurus(term: str)[source]
Searches the provided term in the Oxford American Writer’s Thesaurus
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- search_wikipedia(term: str)[source]
Searches the provided term in Wikipedia
- Parameters:
term (str) – The term to search
New in version 0.0.2.
- start_dictation()[source]
Begins dictation to fill the selected item, if there is one.
New in version 0.0.2.
- switch_to_apple_dictionary()[source]
Switches to searching the Apple Dictionary.
New in version 0.0.2.
- switch_to_new_oxford()[source]
Switches to searching the New Oxford American Dictionary.
New in version 0.0.2.