From f722251e725d6ed0ee8434ad2207a00d7f09c3a7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 8 Oct 2018 17:33:03 +0200 Subject: Add a label to display the filename of the document used Provides a way to confirm that the word counter operated on the expected document. --- Word Count/AppDelegate.applescript | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Word Count/AppDelegate.applescript') diff --git a/Word Count/AppDelegate.applescript b/Word Count/AppDelegate.applescript index 38a3c2e..8cc0d1e 100644 --- a/Word Count/AppDelegate.applescript +++ b/Word Count/AppDelegate.applescript @@ -11,6 +11,7 @@ script AppDelegate -- IBOutlets property theWindow : missing value + property fileName : missing value property theCharacters : missing value property theWords : missing value property theParagraphs : missing value @@ -19,11 +20,13 @@ script AppDelegate tell application "TextEdit" set top_document to document 1 + set l_name to name of top_document set l_chars to count characters of top_document set l_words to count words of top_document set l_paragraphs to count paragraphs of top_document end tell + fileName's setStringValue_(l_name) theCharacters's setStringValue_(l_chars) theWords's setStringValue_(l_words) theParagraphs's setStringValue_(l_paragraphs) -- cgit v1.2.3