Documentation
¶
Overview ¶
Package applescript handles extracting notes and folders from Apple Notes via AppleScript executed through osascript.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAppleScriptDate ¶
ParseAppleScriptDate attempts to parse a date string from AppleScript output. AppleScript's date format depends on the user's macOS locale, so multiple formats are attempted.
func ParseFoldersOutput ¶
ParseFoldersOutput parses the raw osascript output into Folder structs. The output is expected to use fieldDelimiter between fields and folderDelimiter between records.
Types ¶
type AppleScriptExtractor ¶
type AppleScriptExtractor struct {
// contains filtered or unexported fields
}
AppleScriptExtractor extracts notes from Apple Notes by executing AppleScript via the osascript command.
func NewAppleScriptExtractor ¶
func NewAppleScriptExtractor(executor shell.CommandExecutor, logger *zap.Logger) *AppleScriptExtractor
NewAppleScriptExtractor creates a new extractor that uses the given CommandExecutor to invoke osascript.
func (*AppleScriptExtractor) GetAllNotes ¶
func (e *AppleScriptExtractor) GetAllNotes(ctx context.Context, accounts []string, folders []string) ([]model.Note, error)
GetAllNotes returns all notes from Apple Notes, optionally filtered by account names and folder paths.
func (*AppleScriptExtractor) GetFolders ¶
GetFolders returns the complete folder hierarchy from Apple Notes.
type NoteExtractor ¶
type NoteExtractor interface {
// GetFolders returns the complete folder hierarchy across all accounts.
GetFolders(ctx context.Context) ([]model.Folder, error)
// GetAllNotes returns every note, optionally filtered by accounts and folders.
// If accounts is nil, all accounts are included.
// If folders is nil, all folders are included.
GetAllNotes(ctx context.Context, accounts []string, folders []string) ([]model.Note, error)
}
NoteExtractor fetches notes and folders from Apple Notes via AppleScript.