function findSymbolMasterWithId(id) {
  let symbolMaster = sketch.Document.getSelectedDocument()
    .getSymbols()
    .filter(symbol => {
      return symbol.id === id
    })[0]

  // continue looking for the symbol master in libraries
  if (!symbolMaster) {
    let libraries = sketch.getLibraries()
    for (let i = 0; i < libraries.length; ++i) {
      let library = libraries[i]
      if (!library.valid) return

      let symbolReference = library
        .getImportableSymbolReferencesForDocument(Context().document)
        .filter(reference => {
          return reference.id === id
        })[0]

      if (symbolReference) {
        symbolMaster = symbolReference.import()
      }
    }
  }

  return symbolMaster ? symbolMaster.sketchObject : null
}
Finds a symbol master by id.

@param {String} id
@returns {MSSymbolMaster}