Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-12-11 Thread Steve Mills via Cocoa-dev
I mentioned somewhere in one of my replies that you know when it’s being run in the System Prefs preview because isPreview is passed to the main entry point. Steve via iPad > On Dec 11, 2022, at 14:56, Gabriel Zachmann via Cocoa-dev > wrote: > > Thanks again for the responses. And sorry for

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
I was thinking that’d break sandbox encapsulation. But I guess what really matters is what you get when you do the reverse and expand the tilde? > > On Dec 11, 2022, at 17:58, Ben Kennedy via Cocoa-dev > wrote: > >  > >> On 11 Dec 2022, at 12:51 pm, Mike Abdullah via Cocoa-dev >> wrote:

Re: How to convert path through container into standard form?

2022-12-11 Thread Ben Kennedy via Cocoa-dev
> On 11 Dec 2022, at 12:51 pm, Mike Abdullah via Cocoa-dev > wrote: > > Have you tried -URLByResolvingSymlinksInPath? As far as I’m aware, the > Pictures entry inside your container is a symlink to the real thing, so > assuming you have appropriate entitlements, should be possible to

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
Looking back, I guess you’d bump up against the sandbox with this… > > On Dec 11, 2022, at 16:21, Sandor Szatmari > wrote: > > -stringByAbbreviatingWithTildeInPath > > First page in google results > >> On Dec 11, 2022, at 15:06, Gabriel Zachmann via Cocoa-dev >> wrote: >> >>  >> I

Re: How to convert path through container into standard form?

2022-12-11 Thread Sandor Szatmari via Cocoa-dev
-stringByAbbreviatingWithTildeInPath First page in google results > On Dec 11, 2022, at 15:06, Gabriel Zachmann via Cocoa-dev > wrote: > >  > I have an NSURL * pictures_path; > > By default, this is set to > > pictures_path = [ [NSFileManager defaultManager] URLForDirectory: >

Re: Proper way to retrieve the NSScreenNumber in a screen saver ?

2022-12-11 Thread Gabriel Zachmann via Cocoa-dev
Thanks again for the responses. And sorry for following up so much later. (a bit of context is recapped below) First of all, thanks for the hint to viewDidMoveToWindow. So, currently , I do this in my viewDidMoveToWindow: - (void) viewDidMoveToWindow { window_ = [self window];

Re: How to convert path through container into standard form?

2022-12-11 Thread Mike Abdullah via Cocoa-dev
Have you tried -URLByResolvingSymlinksInPath? As far as I’m aware, the Pictures entry inside your container is a symlink to the real thing, so assuming you have appropriate entitlements, should be possible to resolve it. Mike. > On 11 Dec 2022, at 10:56, Gabriel Zachmann via Cocoa-dev >

How to convert path through container into standard form?

2022-12-11 Thread Gabriel Zachmann via Cocoa-dev
I have an NSURL * pictures_path; By default, this is set to pictures_path = [ [NSFileManager defaultManager] URLForDirectory: NSPicturesDirectory inDomain: NSUserDomainMask appropriateForURL: nil create: NO