Friday, July 20, 2018

#1 2018-07-13 08:58:36 am

jaspersiegers
Member
From:: The Netherlands
Registered: 2006-08-30
Posts: 46

PathControl and OS X 10.11 El Capitan issue

Hi,

So I'm having a Path Control in which I set an URL.
When the user clicks on one of the items it will sent an action and execute this code:

Applescript:


on pathAction_(sender)
set theCurrentURL to thePUIGroupPathControl's clickedPathItem()'s |URL|()
set theCurrentURLPathComponents to theCurrentURL's pathComponents()

-- And then some code to deal with the Components

end pathAction_

Where thePUIGroupPathControl is obviously my NSPathControl object.

Now this works perfectly on Sierra and High Sierra but won't work on El Capitan.
I'll get this error:

13-07-18 16:54:14,680 PostLab[1675]: *** -[PUI_Group pathAction:]: missing value doesn’t understand the “pathComponents” message. (error -1708)

So apparently theCurrentURL isn't filled properly. But according the docs this method should work sinds Mac OS 10.10 Yosemite.
So is it possible to get this working on El Capitan? Or should I take my loss?

Cheers in advance!

Jasper

Offline

 

#2 2018-07-13 05:45:17 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5410

Re: PathControl and OS X 10.11 El Capitan issue

I'd double-check that thePUIGroupPathControl is valid and that clickedPathItem() is working before giving up.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2018-07-16 06:30:06 am

jaspersiegers
Member
From:: The Netherlands
Registered: 2006-08-30
Posts: 46

Re: PathControl and OS X 10.11 El Capitan issue

Okay, finally solved this one. Had to set up a VM with 10.11 and Xcode 8.

But I solved it with this:

Applescript:


set theCurrentURL to thePUIGroupPathControl's clickedPathComponentCell()'s |URL|()
set theCurrentURLPathComponents to theCurrentURL's pathComponents()

Although this method is deprecated according to the documentation it still works on El Capitan and High Sierra.

Offline

 

#4 2018-07-16 08:20:28 am

jaspersiegers
Member
From:: The Netherlands
Registered: 2006-08-30
Posts: 46

Re: PathControl and OS X 10.11 El Capitan issue

My bad...

So the code works on all OS'es. When I create a sample project on Mac OS X 10.11 with Xcode 8 with only a path control it will work on all OS'es.
When I create an application from High Siera and Xcode 9 from the same project it will run on 10.11.

But when I use that same code in my application it won't work on El Capitan.
This is frustrating.

Don't know where to look any more. More ideas anyone?

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)