when words aren't words
when words aren't words
- Subject: when words aren't words
- From: Bill Briggs <email@hidden>
- Date: Mon, 14 Nov 2005 08:31:21 -0400
A little debugging on a script last night revealed that "words" as seen by AppleScript aren't always what "words" are to an application.
If you were to make a text document in Tex-Edit Plus and put in this line (a fake file path)
thisis ashort/path/to/files/wherethere/are some/directory/names with/spaces
then run this script.
tell application "Tex-Edit Plus"
tell front document
set w to words of paragraph 1
set x to text of paragraph 1
end tell
end tell
set y to words of x
{w, ASCII character 13, y}
--> {{"thisis", "ashort/path/to/files/wherethere/are", "some/directory/names", "with/spaces"}, "
", {"thisis", "ashort", "path", "to", "files", "wherethere", "are", "some", "directory", "names", "with", "spaces"}}
Words as seen by Tex-Edit Plus are not words as defined by the AppleScript Language Guide. Useful, but not the same. TextEdit gives the same result as AppleScript.
It sure would be nice if text processing applications had their own text item delimiters. More than a decade ago a little application called Scriptable Text Editor was supposed to show how it was to be done. That bare bones text editor had its own text item delimiters.
- web
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden