• 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: Requesting help with ObjC conversion, please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Requesting help with ObjC conversion, please


  • Subject: Re: Requesting help with ObjC conversion, please
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 18 Aug 2014 10:39:49 +1000

On 18 Aug 2014, at 10:11 am, Brian Christmas <email@hidden> wrote:

I really, really struggle with how to convert ObcC statements to Applescript's.

I cannot work out how to convert 

- (NSDate *)earlierDate:(NSDate *)anotherDate

I've tried this (amongst heaps of other things)..

if (earlierDate_(checkStartDateTimeNSDAte, my finishDateTimeNSDAte)) then

It looks like you're after a method that compares two dates. So why are you trying to use a method that clearly says it returns an NSDate?  And how can you expect it to accept two arguments when it clearly says it takes one? And how do you expect an instance method to work when you don't call it on an instance?

If you wanted to use the method, it would be something like:

 checkStartDateTimeNSDAte's earlierDate_(my finishDateTimeNSDAte)

And that would return a date, just like it says. I suppose you could then compare that date to one of the original dates, but that's more work than needed.

Use this:

if ((checkStartDateTimeNSDAte's compare_(my finishDateTimeNSDAte)) > 0) then -- or < 0, depending on what you're after


And please, fix the case in those DAte variable names. I know it doesn't matter functionally, but it grates terribly.

-- 
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: 
 >Requesting help with ObjC conversion, please (From: Brian Christmas <email@hidden>)

  • Prev by Date: Requesting help with ObjC conversion, please
  • Next by Date: Using shell script's xattr
  • Previous by thread: Requesting help with ObjC conversion, please
  • Next by thread: Using shell script's xattr
  • Index(es):
    • Date
    • Thread