• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cannot coerce field contents to text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot coerce field contents to text?


  • Subject: Re: Cannot coerce field contents to text?
  • From: Brian Christmas <email@hidden>
  • Date: Sun, 07 Dec 2014 10:35:55 +1100

Thanks Shane, 

I didn’t want to complicate matters unnecessarily, and I did state that the field is supposed to contain email addresses, and I only wanted to add a return at the end, so I don’t know what on earth you’re trying to guess. Perhaps you missed what I wrote.

However, your stringValue() is what I was after; works well, so thanks again.

Regards

Santa


on setMailList2:sender
try
set my mailAddressesSecondaryError to stringValue() of sender as text -- Shanes eBook says to coerce to text
if (last paragraph of my mailAddressesSecondaryError) ≠ "" then set my mailAddressesSecondaryError to my mailAddressesSecondaryError & return
my saveTheGeneralData()
on error errmsg number errNum
display dialog "setMailList2 " & errmsg & " number " & errNum
end try
end setMailList2:

On 7 Dec 2014, at 10:09 am, Shane Stanley <email@hidden> wrote:

On 7 Dec 2014, at 10:01 am, Brian Christmas <email@hidden> wrote:

In Yosemite, I’ve spent several hours trying various things with this, and poring over Explored 5, but cannot get the contents of a field to coerce to text.

If sender is a text field, contents is no use -- you'd want stringValue(). But you're giving us no real hint what sender contains, and you're not logging it yourself to see, so we're stuck with guesswork.

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
Do not post admin requests to the list. They will be ignored. applescriptobjc-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Cannot coerce field contents to text? (From: Brian Christmas <email@hidden>)
 >Re: Cannot coerce field contents to text? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Cannot coerce field contents to text?
  • Next by Date: Trying to keep a set-up windows open.
  • Previous by thread: Re: Cannot coerce field contents to text?
  • Next by thread: Trying to keep a set-up windows open.
  • Index(es):
    • Date
    • Thread