Skip to content

Pre-release v0.0.9

Pre-release
Pre-release
Compare
Choose a tag to compare
@SKaplanOfficial SKaplanOfficial released this 25 Aug 23:29

Additions

  • XASpotlight class — ability to search for files on the disk using Spotlight
    • Returns a list of XAURL objects
    • Supports searching by string, date, date range, and combinations of those
    • Supports searching by custom predicate
    • XASpotlight.run() — Runs the search
    • XASpotlight.show_in_finder() — Shows the search in Finder (but might not display the exact same results)
  • XANotification — ability to display notifications, currently supported by osascript
    • XANotification.display() — Displays the notification
  • XACommandDetector — ability to listen for specific spoken commands and react accordingly
    • XACommandDetector.on_detect() — Adds or replaces a command to listen for and associates it with a specified function
    • XACommandDetector.listen() — Begins listening for all specified commands
  • XASpeechRecognizer — ability to listen for spoken queries matching some condition and react accordingly
    • XASpeechRecognizer.on_detect() — Adds a rule that executes some method when a query meets the conditions of the rule
    • XASpeechRecognizer.listen() — Begins listening for a query, continues until a rule returns True
  • XASpeech — ability to speak text with customizable voices, volume, and speaking rate
    • XASpeech.speak() — Speaks the specified text or outputs the spoken audio to an AIFF file
    • XASpeech.voice() — Lists available voice names
  • XAMenuBar — ability to create menus on the system menu/status bar + ability to add items to those menus that execute specified functions when clicked
    • Supports images
    • Supports runtime changes to menu display parameters (text, image)
    • Automatically adds “Quit” item to menus
    • XAMenuBar.add_menu() — Adds a new menu
    • XAMenuBar.add_item() — Adds a new item to a menu
    • XAMenuBar.set_image() — Sets the image displayed for a menu or menu item
    • XAMenuBar.set_text() — Sets the text displayed for a menu or menu item
    • XAMenuBar.display() — Displays the menu bar, keeping it displayed until the program is quit
    • Examples:
      • JWSTMenuBar
      • CPUMonitor
  • New methods for AppleScript class
    • AppleScript.insert() — Inserts a string, list of strings, or script object as a line entry in the current script
    • AppleScript.pop() — Removes and returns the line at the specified index of the script
    • AppleScript.load() — Loads an AppleScript .scpt file as a runnable AppleScript object
    • AppleScript.save() — Saves the current script to the specified file path
    • AppleScript.extract_result_data() — Attempts to extract string data from an execution result dictionary
  • New features for XALocation class
    • XALocation.current_location property — Holds the user’s current location object
  • PyXA.scriptable_applications variable — Holds a list of the currently supported applications
  • Setters for properties on many classes
  • Support for new applications
    • Fantastical
    • OmniOutliner
    • Script Editor
  • Documentation for many more classes and methods

Changes

  • All new classes going forward will utilize @Property and @x.setter decorators; existing classes will be updated over the course of the next few updates.
  • Several methods have been converted to attributes of the parent class
    • XATerminalApplication.current_tab()
    • XATerminalWindow.selected_tab()
    • XATerminalTab.current_settings()
  • XAColor can now be instantiated using PyXA.XAColor()
  • Various small bug fixes

Deprecations

  • XAObject.has_element() — Perform this check manually instead.
  • XAObject.set_element() — Set the element attribute directly instead.

Removals

  • PyXA.open_url() — Deprecated in v0.0.5, now completely replaced by XAURL class
  • PyXA.get_clipboard(), PyXA.get_clipboard_strings(), PyXA.set_clipboard() — Deprecated in v0.0.5, now completely replaced by XAClipboard class
  • PyXA.run_application() — Deprecated in v0.0.5, now completely replaced by AppleScript class