TextEdit Can't Find Without "as text"
TextEdit Can't Find Without "as text"
- Subject: TextEdit Can't Find Without "as text"
- From: Gil Dawson <email@hidden>
- Date: Sun, 12 Aug 2007 08:04:44 -0700
Dear Gurus--
Please help me understand the difference between
(first name of person 1) as text
and
first name of person 1
in the Address Book application (Version 4.0.5, MacOS 10.4.10).
The demo script copied below produces a file on my desktop. When I
double-click on that file, it opens a TextEdit window containing:
John
orange banana
cherry plum
In the TextEdit application, I can (command-F) Find any of the
strings "ohn", "herry" and so on, but
for the string "arl", TextEdit's Find window says "Not Found".
Clearly the "as text" phrase in the demo script below is essential, but why?
--Gil
Here's the demo script that illustrates the difference:
-- Demo TextEdit Find Unable
set NewFilePath to ((path to desktop) as string) & "TE Demo.csv"
try
close access file NewFilePath
end try
open for access file NewFilePath with write permission
set eof file NewFilePath to 0
tell application "Address Book"
set n1 to (first name of person 1) as text
set n2 to first name of person 2
end tell
write n1 & return to file NewFilePath
write n2 & return to file NewFilePath
write "orange banana" & return to file NewFilePath
write "cherry plum" & return to file NewFilePath
close access file NewFilePath
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden