• 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: Date pickers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date pickers


  • Subject: Re: Date pickers
  • From: Craig Williams <email@hidden>
  • Date: Wed, 10 Mar 2010 08:04:41 -0700


On Mar 10, 2010, at 6:14 AM, Deivy Petrescu wrote:


On 09/03/2010, at 22:44 , Shane Stanley wrote:

On 10/3/10 10:58 AM, "Deivy Petrescu" <email@hidden> wrote:

However this does not!

set zdate to (what_date's dateValue()) -- gets date value from date field
set d5 to 3600 * 24 * 5
return zdate's dateByAddingTimeInterval_(d5)

-->Can’t make «class ocid» id «data kptr00000000A055590002000000» into type
Unicode text.

I thought dateValue() would make zdate into an NSDate. Apparently I am wrong.

It works fine here. I'd check you what_date connection in IB.

--
Shane Stanley <email@hidden>
AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>




Thank you so much Shane.

It does work. My error was happening in the log call.

log zdate

works, however

log "This is " & zdate

does not.

The point is, when working in ASOC we are really in no man's land.
We are not using AppleScript and we are not using Objective-C...
We are doomed...  :)

Unfortunately this app has to be written in ASOC.
The next one will be Objective-C or some lower level language.
ASOC could be promising if there were a bit more of a guide.
By the way, I do appreciate all the information (thanks Shane) and the many web examples (thanks Craig).
A bit of light in this vast darkness.


Deivy Petrescu
email@hidden

You're welcome.

The reason that

log "This is" & zdate

does not work is because you have an Objective-C NSDate object instead of a string representation.
Just like you cannot do

log (current date)

but instead must convert it to a string

log (current date) as string

For your log, try this instead.

log "This is " & zdate's description

NSObject has the description method so it flows down to all classes that inherit from it, which is just
about all of them. The description method return a string that represents the contents of the receiving class. 

I think the hardest part about learning AppleScriptObjC is learning Objective-C and knowing
when you have an AppleScript object and when you have an Objective-C object. Once you 
understand that, knowing which methods to call and how to convert between them become easy.

Just remember, when calling an Objective-C method on an AppleScript object, you must convert it to
an Objective-C object first. The same goes for calling AppleScript methods on an Objective-C
object, convert it to an AppleScript object first.

hth,

Craig




 _______________________________________________
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

  • Follow-Ups:
    • Re: Date pickers
      • From: Deivy Petrescu <email@hidden>
References: 
 >Re: Date pickers (From: Shane Stanley <email@hidden>)
 >Re: Date pickers (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Date pickers
  • Next by Date: Re: Date pickers
  • Previous by thread: Re: Date pickers
  • Next by thread: Re: Date pickers
  • Index(es):
    • Date
    • Thread