Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TextEdit Can't Find Without "as text"



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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.