Hi Ray,

I think you may have tried to save the script to a non-existent folder.  When I 
read your earlier post, you stated your save location was 
"Macintosh/Library/Scripts" (without the quotation marks) so if you used the 
Command-Shift-G "Go to folder" shortcut to specify the folder location to save 
to, you'd get an error because you either have to type "/Volumes/Macintosh 
HD/Library/Scripts" or "/Library/Scripts" (without the quotation marks) to have 
a legal address that points to your system Scripts folder. 

The code you have in this message is fine. The way you can check this after you 
copy and paste it into an AppleScript Editor window, is by pressing Command-R 
to compile the script.  If you don't have TextEdit open at the time, it will 
say "0 words and 0 characters"; but with TextEdit open, it announces the word 
and character count of the foremost window. 

Write back if this doesn't sort your problem, and I'll compose more detailed 
instructions.  If you're going to assign a keyboard shortcut using the 
VoiceOver Keyboard Commanders pane, you don't need to save the AppleScript in 
any particular Scripts folder in the system library or under your personal 
library -- you just have to point to whatever location you used when you 
associate the AppleScript with a file on the Keyboard Commanders pane of 
VoiceOver Utility.

I set up a folder in my home directory named "~/Library/Scripts/VoiceOver 
Scripts" (where the initial tilde indicates my home directory, and where I've 
put quotation marks around the folder name).  I saved the AppleScript as a 
Script with the name "TextEdit Word Count", and I had to create the folder 
named "VoiceOver Scripts".  You can use any names you like for you folder and 
script, and you don't even have to put it in the ~/Library/Scripts/ folder.

Under the Keyboard Commander pane, I navigated to "Add" button to add a new 
keyboard command and pressed with VO-Space.  Then I typed "w" for the assigned 
key, pressed VO-Right arrow to navigate to the menu button and pressed 
VO-Space, then pressed Command+down arrow to move to the "Custom Commands" 
option at the end of the menu, pressed Right arrow to move to the sub-menu, 
arrowed down to "Run AppleScript Script" and pressed "Return".  At that point 
you can use Command-Shift-G to locate the folder containing your word count 
script file and open it.  As previously stated, if you're using this via a 
Keyboard Command shortcut assignment, you can put that file anywhere and name 
it anything you like.  It could, for example, be in a folder within your 
Documents folder.

HTH.  And Matt was speaking of the stars that Hai Nguyen Lai typed as a divider 
between the text of his mail message and the lines of AppleScript.  I don't 
think that was your problem.  Cheers,

Esther

On Nov 19, 2011, at 14:35, Ray Foret Jr wrote:

> What stars?  somehow, it's jus not working for me.  Could it be the way the 
> code is written; or, perhaps, the way it's coppied and pasted?  I'm just not 
> getting anywhere with  this blasted thing!!!
> 
> Here's the code.
> 
> 
>>>> tell document 1 of application "TextEdit"
>>>>    set wordcount to the (count of words) as text
>>>>    set charactercount to the (count of characters) as text
>>>> end tell
>>>> say wordcount & " words and " & charactercount & " characters"
>>> 
> 
> Could it be the line breaks perhaps?
> 
> 
> 
> Sincerely,
> The Constantly Barefooted Ray!!!
> 
> Now a very proud and happy Mac user!!!
> 
> Skype name:
> barefootedray
> 
> Facebook:
> facebook.com/ray.foretjr.1
> 
> 
> 
> On Nov 19, 2011, at 5:46 PM, Matt Dierckens wrote:
> 
>> That's weird. Mine workedjust fine. Get rid of the stars at the begining at 
>> the script and you should be all set.
>> Matt
>> Sent from my macbook pro
>> 
>> On 2011-11-19, at 6:43 PM, Ray Foret Jr wrote:
>> 
>>> Hi,
>>> 
>>> I tried to send this yesterday but got no response what so ever.
>>> 
>>> Hi,
>>> 
>>> I'm trying to work with the following code:
>>> 
>>>> tell document 1 of application "TextEdit"
>>>>    set wordcount to the (count of words) as text
>>>>    set charactercount to the (count of characters) as text
>>>> end tell
>>>> say wordcount & " words and " & charactercount & " characters"
>>> 
>>> 
>>> I paste it in to the source box and leave everything else as it is with the 
>>> results box checked and the Results radio button selected.  No matter how 
>>> much I try, though, I just cannot save the thing.  I try to save it in the 
>>> Macintosh/Library/Scripts folder but I get a dialog that says that the 
>>> script cannot be saved.  What gives?  Could it possibly be the quotation 
>>> signs or what is it?  Something must be wrong with the code because it just 
>>> will not save.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Sincerely,
>>> The Constantly Barefooted Ray!!!
>>> 

-- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/macvisionaries?hl=en.

Reply via email to