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 +++
Word Count/Base.lproj/MainMenu.xib | 22 ++++++++++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
(limited to 'Word Count')
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)
diff --git a/Word Count/Base.lproj/MainMenu.xib b/Word Count/Base.lproj/MainMenu.xib
index d2e0eaa..1ea049b 100644
--- a/Word Count/Base.lproj/MainMenu.xib
+++ b/Word Count/Base.lproj/MainMenu.xib
@@ -15,6 +15,7 @@
+
@@ -686,10 +687,10 @@
-
+
-
+
-
+
--
cgit v1.2.3