Hi Jonathan,

I shared scripts for this sort of counting in a different post.  I'm thinking 
that Brian was simply commenting on these scripts, not asking for them.  I 
could be mistaken though.  In either case, here's the gist of the script I 
shared:

if application "TextEdit" is running then
        tell application "TextEdit"
                set WordCount to the number of words in the the front document
                display dialog ("The wordcount is: " & WordCount)
        end tell
else
        display dialog "Error.  TextEdit is not running."
end if

When the script is called with a VO Keyboard Commander shortcut, it's important 
to have some error checks.  I've had this one display a dialog instead of VO 
just announcing the count so that it's easily read out again if needed.
Tim Kilburn
Fort McMurray, AB Canada

On Feb 12, 2017, at 11:42, Jonathan Cohn <[email protected]> wrote:

This should be a one line script, but I believe that in some some applications 
it will not work.

A general script would be
tell frontmost application
        set CharacterCount to the count of characters of document 1
end tell
set spokenText to "The character count is " & CharacterCount
tell application "VoiceOver" to output spokenText
delay 3         Best wishes,

The delay is there because you need to give VoiceOVer a chance to produce 
output before the script exits. I am not quite sure about the frontmost 
application, and it also might be that some word processors would need you to 
specify a window for the document.

document of window 1 or document 1 of window 1 
Also, for mail the Document property would not work but "body would work if 
that is what you are after.


Best wishes,
Jonathan Cohn 



> On Feb 11, 2017, at 8:28 PM, Brian Hansen <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> Hi Tim,
> 
> Thanks for all of your help, as well as the scripts for iTunes.  I’ve been 
> wondering if there was a way to have character and word count scripts.  
> Thanks again for everything.
> 
> Blessings,
> 
> Brian
> 
>> On Feb 9, 2017, at 7:47 PM, Tim Kilburn <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hi,
>> 
>> Download the script for this from here:
>> 
>> https://drive.google.com/drive/folders/0B6iLRtMzHPEXSzQ2LWNKc3NtVzA?usp=sharing
>>  
>> <https://drive.google.com/drive/folders/0B6iLRtMzHPEXSzQ2LWNKc3NtVzA?usp=sharing>
>> 
>> I've made some modifications to the code I found shared by some others.  
>> Should do the trick.  It will return the song title and artist and say a few 
>> extra things if iTunes is not running or if music is paused/stopped.
>> 
>> Later...
>> 
>> Tim Kilburn
>> Fort McMurray, AB Canada
>> 
>> On Feb 8, 2017, at 20:28, Brian Hansen <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> A keyboard command like that would be great.
>> 
>> Blessings,
>> 
>> Brian
>> 
>>> On Feb 8, 2017, at 4:10 PM, Jonathan C. Cohn <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Is this a command that people would like a keyboard shortcut to do for many 
>>> application?
>>> 
>>> Best wishes,
>>> 
>>> Jonathan Cohn 
>>> 
>>>> On Feb 8, 2017, at 3:08 PM, Tim Kilburn <[email protected] 
>>>> <mailto:[email protected]>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It appears that you're in Album view and my suggestion won't work in that 
>>>> view.  I suggest that you use a HotSpot instead.  So, when a song is 
>>>> playing, interact with the LCD Panel.  Navigate to the title of the song 
>>>> that is playing, then press VO-shift-1.  This will set that exact location 
>>>> as HotSpot #1.  So, anytime you wish to hear the name of the currently 
>>>> playing song, just press VO-1 and VO should read whatever text is at that 
>>>> HotSpot location.  the limitation with this method is that the HotSpots 
>>>> are usually lost whenever iTunes is quit.
>>>> 
>>>> Later...
>>>> 
>>>> Tim Kilburn
>>>> Fort McMurray, AB Canada
>>>> 
>>>> On Feb 8, 2017, at 11:59, Brian Hansen <[email protected] 
>>>> <mailto:[email protected]>> wrote:
>>>> 
>>>> Hi Tim
>>>> 
>>>> When I hit CMD-l, VO says, the phrase “current song”, and then album, but 
>>>> nothing else after that.  It doesn’t actually announce the song title.
>>>> 
>>>> Blessings,
>>>> 
>>>> Brian
>>>> 
>>>>> On Feb 8, 2017, at 12:47 PM, Tim Kilburn <[email protected] 
>>>>> <mailto:[email protected]>> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> While in iTunes, you could press cmd-l to move focus to the currently 
>>>>> playing song and VO should announce what it is right away.
>>>>> 
>>>>> Later...
>>>>> 
>>>>> Tim Kilburn
>>>>> Fort McMurray, AB Canada
>>>>> 
>>>>> On Feb 8, 2017, at 11:45, Brian Hansen <[email protected] 
>>>>> <mailto:[email protected]>> wrote:
>>>>> 
>>>>> Is there a built-in keyboard command, or a VO command to quickly find out 
>>>>> the name of the currently playing track?  I’ve got a couple of albums 
>>>>> that I downloaded that I wanted to know the name and track number of the 
>>>>> song I was on.  Thanks.
>>>>> 
>>>>> Blessings,
>>>>> 
>>>>> Brian
>>>>> 
>>>>> -- 
>>>>> The following information is important for all members of the Mac 
>>>>> Visionaries list.
>>>>> 
>>>>> If you have any questions or concerns about the running of this list, or 
>>>>> if you feel that a member's post is inappropriate, please contact the 
>>>>> owners or moderators directly rather than posting on the list itself.
>>>>> 
>>>>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark 
>>>>> at:  [email protected] 
>>>>> <mailto:[email protected]> and your owner is Cara 
>>>>> Quinn - you can reach Cara at [email protected] 
>>>>> <mailto:[email protected]>
>>>>> 
>>>>> The archives for this list can be searched at:
>>>>> http://www.mail-archive.com/[email protected]/ 
>>>>> <http://www.mail-archive.com/[email protected]/>
>>>>> --- 
>>>>> You received this message because you are subscribed to the Google Groups 
>>>>> "MacVisionaries" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>>> email to [email protected] 
>>>>> <mailto:[email protected]>.
>>>>> To post to this group, send email to [email protected] 
>>>>> <mailto:[email protected]>.
>>>>> Visit this group at https://groups.google.com/group/macvisionaries 
>>>>> <https://groups.google.com/group/macvisionaries>.
>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>> <https://groups.google.com/d/optout>.
>>>>> 
>>>>> -- 
>>>>> The following information is important for all members of the Mac 
>>>>> Visionaries list.
>>>>> 
>>>>> If you have any questions or concerns about the running of this list, or 
>>>>> if you feel that a member's post is inappropriate, please contact the 
>>>>> owners or moderators directly rather than posting on the list itself.
>>>>> 
>>>>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark 
>>>>> at:  [email protected] 
>>>>> <mailto:[email protected]> and your owner is Cara 
>>>>> Quinn - you can reach Cara at [email protected] 
>>>>> <mailto:[email protected]>
>>>>> 
>>>>> The archives for this list can be searched at:
>>>>> http://www.mail-archive.com/[email protected]/ 
>>>>> <http://www.mail-archive.com/[email protected]/>
>>>>> --- 
>>>>> You received this message because you are subscribed to the Google Groups 
>>>>> "MacVisionaries" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>>> email to [email protected] 
>>>>> <mailto:[email protected]>.
>>>>> To post to this group, send email to [email protected] 
>>>>> <mailto:[email protected]>.
>>>>> Visit this group at https://groups.google.com/group/macvisionaries 
>>>>> <https://groups.google.com/group/macvisionaries>.
>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> -- 
>>>> The following information is important for all members of the Mac 
>>>> Visionaries list.
>>>> 
>>>> If you have any questions or concerns about the running of this list, or 
>>>> if you feel that a member's post is inappropriate, please contact the 
>>>> owners or moderators directly rather than posting on the list itself.
>>>> 
>>>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark 
>>>> at:  [email protected] 
>>>> <mailto:[email protected]> and your owner is Cara 
>>>> Quinn - you can reach Cara at [email protected] 
>>>> <mailto:[email protected]>
>>>> 
>>>> The archives for this list can be searched at:
>>>> http://www.mail-archive.com/[email protected]/ 
>>>> <http://www.mail-archive.com/[email protected]/>
>>>> --- 
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "MacVisionaries" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to [email protected] 
>>>> <mailto:[email protected]>.
>>>> To post to this group, send email to [email protected] 
>>>> <mailto:[email protected]>.
>>>> Visit this group at https://groups.google.com/group/macvisionaries 
>>>> <https://groups.google.com/group/macvisionaries>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> -- 
>>>> The following information is important for all members of the Mac 
>>>> Visionaries list.
>>>> 
>>>> If you have any questions or concerns about the running of this list, or 
>>>> if you feel that a member's post is inappropriate, please contact the 
>>>> owners or moderators directly rather than posting on the list itself.
>>>> 
>>>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark 
>>>> at:  [email protected] 
>>>> <mailto:[email protected]> and your owner is Cara 
>>>> Quinn - you can reach Cara at [email protected] 
>>>> <mailto:[email protected]>
>>>> 
>>>> The archives for this list can be searched at:
>>>> http://www.mail-archive.com/[email protected]/ 
>>>> <http://www.mail-archive.com/[email protected]/>
>>>> --- 
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "MacVisionaries" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to [email protected] 
>>>> <mailto:[email protected]>.
>>>> To post to this group, send email to [email protected] 
>>>> <mailto:[email protected]>.
>>>> Visit this group at https://groups.google.com/group/macvisionaries 
>>>> <https://groups.google.com/group/macvisionaries>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>> 
>>> -- 
>>> The following information is important for all members of the Mac 
>>> Visionaries list.
>>> 
>>> If you have any questions or concerns about the running of this list, or if 
>>> you feel that a member's post is inappropriate, please contact the owners 
>>> or moderators directly rather than posting on the list itself.
>>> 
>>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark at: 
>>>  [email protected] 
>>> <mailto:[email protected]> and your owner is Cara 
>>> Quinn - you can reach Cara at [email protected] 
>>> <mailto:[email protected]>
>>> 
>>> The archives for this list can be searched at:
>>> http://www.mail-archive.com/[email protected]/ 
>>> <http://www.mail-archive.com/[email protected]/>
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "MacVisionaries" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected] 
>>> <mailto:[email protected]>.
>>> To post to this group, send email to [email protected] 
>>> <mailto:[email protected]>.
>>> Visit this group at https://groups.google.com/group/macvisionaries 
>>> <https://groups.google.com/group/macvisionaries>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
>> 
>> -- 
>> The following information is important for all members of the Mac 
>> Visionaries list.
>> 
>> If you have any questions or concerns about the running of this list, or if 
>> you feel that a member's post is inappropriate, please contact the owners or 
>> moderators directly rather than posting on the list itself.
>> 
>> Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark at:  
>> [email protected] 
>> <mailto:[email protected]> and your owner is Cara 
>> Quinn - you can reach Cara at [email protected] 
>> <mailto:[email protected]>
>> 
>> The archives for this list can be searched at:
>> http://www.mail-archive.com/[email protected]/ 
>> <http://www.mail-archive.com/[email protected]/>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "MacVisionaries" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> Visit this group at https://groups.google.com/group/macvisionaries 
>> <https://groups.google.com/group/macvisionaries>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
>> 
>> 
>> -- 
>> The following information is important for all members of the Mac 
>> Visionaries list.
>>  
>> If you have any questions or concerns about the running of this list, or if 
>> you feel that a member's post is inappropriate, please contact the owners or 
>> moderators directly rather than posting on the list itself.
>>  
>> Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: 
>> [email protected] 
>> <mailto:[email protected]> and your owner is Cara 
>> Quinn - you can reach Cara at [email protected] 
>> <mailto:[email protected]>
>>  
>> The archives for this list can be searched at:
>> http://www.mail-archive.com/[email protected]/ 
>> <http://www.mail-archive.com/[email protected]/>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "MacVisionaries" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> Visit this group at https://groups.google.com/group/macvisionaries 
>> <https://groups.google.com/group/macvisionaries>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> The following information is important for all members of the Mac Visionaries 
> list.
>  
> If you have any questions or concerns about the running of this list, or if 
> you feel that a member's post is inappropriate, please contact the owners or 
> moderators directly rather than posting on the list itself.
>  
> Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: 
> [email protected] 
> <mailto:[email protected]> and your owner is Cara 
> Quinn - you can reach Cara at [email protected] 
> <mailto:[email protected]>
>  
> The archives for this list can be searched at:
> http://www.mail-archive.com/[email protected]/ 
> <http://www.mail-archive.com/[email protected]/>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "MacVisionaries" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/macvisionaries 
> <https://groups.google.com/group/macvisionaries>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.


-- 
The following information is important for all members of the Mac Visionaries 
list.
 
If you have any questions or concerns about the running of this list, or if you 
feel that a member's post is inappropriate, please contact the owners or 
moderators directly rather than posting on the list itself.
 
Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: 
[email protected] and your owner is Cara Quinn - you 
can reach Cara at [email protected]
 
The archives for this list can be searched at:
http://www.mail-archive.com/[email protected]/ 
<http://www.mail-archive.com/[email protected]/>
--- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected] 
<mailto:[email protected]>.
To post to this group, send email to [email protected] 
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/macvisionaries 
<https://groups.google.com/group/macvisionaries>.
For more options, visit https://groups.google.com/d/optout 
<https://groups.google.com/d/optout>.

-- 
The following information is important for all members of the Mac Visionaries 
list.

If you have any questions or concerns about the running of this list, or if you 
feel that a member's post is inappropriate, please contact the owners or 
moderators directly rather than posting on the list itself.

Your Mac Visionaries list moderator is Mark Taylor.  You can reach mark at:  
[email protected] and your owner is Cara Quinn - you 
can reach Cara at [email protected]

The archives for this list can be searched at:
http://www.mail-archive.com/[email protected]/
--- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/d/optout.

Reply via email to