--- /dev/null
+OSACOMPILE := osacompile
+INSTALL := install
+INSTALLDIR := ~/Library/Scripts
+TARGET := txt2noteapp.scpt
+
+all: $(TARGET)
+
+install: $(TARGET)
+ $(INSTALL) $< $(INSTALLDIR)/
+
+%.scpt: %.applescript
+ $(OSACOMPILE) -o $@ $<
+
+distclean:
+ $(RM) $(TARGET)
--- /dev/null
+# txt2memo.scpt
+
+AppleScript to send the contents of a plain text (`.txt`) file to the macOS Notes app as a new note.
+
+## Features
+
+- Uses the first line of the file as the note title
+- Converts each line of the text into a separate line in the note
+- Optionally converts line breaks to `<br>` (HTML-style line breaks)
+- Supports automatic tagging using lines that begin with `#` (Notes app tags)
+
+## Requirements
+
+- macOS 11.0 or later
+- Notes app
+- Terminal access (`osascript`)
+- Input file must be a plain text file encoded in **UTF-8**.
+
+## Installation
+
+To install the AppleScript file:
+
+```sh
+make install
+
+This will install the script to: `~/Library/Scripts/`
+
+
+## Usage
+
+From the terminal:
+
+```sh
+osascript ~/Library/Scripts/txt2memo.scpt /path/to/textfile.txt
--- /dev/null
+on run argv
+ set filePath to item 1 of argv
+ try
+ open for access filePath
+ set fileContent to read filePath as «class utf8»
+ on error
+ end try
+ close access filepath
+
+ if (count of paragraphs of fileContent) = 0 then
+ display dialog "The file is empty." buttons {"OK"} default button "OK"
+ return
+ end if
+
+ set titleLine to paragraph 1 of fileContent
+ set bodyLines to rest of paragraphs of fileContent
+
+ my createNote(titleLine, my addBr(bodyLines))
+end run
+
+on addBr(linesList)
+ set outputText to ""
+ repeat with aLine in linesList
+ set outputText to outputText & aLine & "<br>" & return
+ end repeat
+ return outputText
+end addBr
+
+on createNote(titleText, bodyText)
+ tell application "Notes"
+ tell account "iCloud"
+ tell folder "Notes"
+ make new note with properties {name:titleText, body:bodyText}
+ end tell
+ end tell
+ end tell
+end createNote