• 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: strange difference in compilation of two Foundation classes in ASObjC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange difference in compilation of two Foundation classes in ASObjC


  • Subject: Re: strange difference in compilation of two Foundation classes in ASObjC
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 20 Mar 2017 10:19:24 +1100

On 20 Mar 2017, at 4:16 am, Mitchell L Model <email@hidden> wrote:

In a brief ASObjC script I used:the following successfully
my NSFileManager's defaultManager
However, the following:
my NSURL's fileURLWithPath:arg
gets compiled into:
my (nsurl's fileURLWithPath:arg)
which of course doesn't work. (The parentheses are misplaced and NSURL has been lowercased.) 

Nigel's given you the answer, but let me also suggest you stop using "my" that way. It only works in some contexts, it only works by chance -- it's not meant to -- and it's not guaranteed to continue working. The correct form is "current application's NSWhatever". If you find that too imposing, declare properties:

property NSWhatever : a reference to current application's NSWhatever

Script Debugger's code-completion can do that for you automatically (as well as piping |NSURL| or any other Cocoa term if required).

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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

References: 
 >strange difference in compilation of two Foundation classes in ASObjC (From: Mitchell L Model <email@hidden>)

  • Prev by Date: Re: about PDFpenPro
  • Next by Date: My script won't be running stably
  • Previous by thread: Re: strange difference in compilation of two Foundation classes in ASObjC
  • Next by thread: Re: strange difference in compilation of two Foundation classes in ASObjC
  • Index(es):
    • Date
    • Thread