Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 2.66 KB

hs.plist.md

File metadata and controls

31 lines (24 loc) · 2.66 KB

docs » hs.plist


Read and write Property List files

API Overview

  • Functions - API calls offered directly by the extension
  • read
  • write

API Documentation

Functions

Signature hs.plist.read(filepath) -> table
Type Function
Description Loads a Property List file
Parameters
  • filepath - The path and filename of a plist file to read
Returns
  • The contents of the plist as a Lua table
Signature hs.plist.write(filepath, data[, binary]) -> boolean
Type Function
Description Writes a Property List file
Parameters
  • filepath - The path and filename of the plist file to write
  • data - A Lua table containing the data to write into the plist
  • binary - An optional boolean, if true, the plist will be written as a binary file. Defaults to false
Returns
  • A boolean, true if the plist was written successfully, otherwise false
Notes
  • Only simple types can be converted to plist items:
  • Strings
  • Numbers
  • Booleans
  • Tables
  • You should be careful when reading a plist, modifying and writing it - Hammerspoon may not be able to preserve all of the datatypes via Lua