Re: setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
> Is it not enough to use NSWorkspace’s showSearchResultsForQueryString?
>

I need to see what queries this allows.
(IIRC there were two different ways to specifying search queries)

But this looks perfect! I didn't realize this was available on NSWorkspace.
Thank you so much.

I'll report back when I have some more details.
But this is looking promising!

cheers,
Torsten

https://torstencurdt.com/
https://twitter.com/tcurdt
https://www.linkedin.com/in/tcurdt/

Ever had broken flip flops

?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Alex Zavatone via Cocoa-dev
This might be an actual good application of launching a compiled AppleScript or 
even an Automator action.

I seem to remember making terminal applications in Xcode.  I wonder if you 
could do that with an AS-OC script and then just call the application within 
your bundle to 

Activate the Finder
Open a new window
Press command F
Type text.

Of course, you’d need to request GUI Scripting control.

You could also just have the compiled script within your bundle and call it.  
Just compile it  using osacompile.

osacompile -o output.app input.applescript

Cheers,
Alex Zavatone

> On Dec 13, 2022, at 2:48 PM, Torsten Curdt via Cocoa-dev 
>  wrote:
> 
> Thanks for the help, Rob
> 
> Is it always going to be the same search?  If so, you could create a Saved
>> Search in the Finder and include it with your app.  Then when you want to
>> bring up the search you can open the Saved Search bundle and it will open
>> in the Finder.  Hope that helps.
>> 
> 
> I was hoping to pass it in so that search parameters are still accessible
> to the user.
> Basically the same as CMD+F and entering some search parameters.
> That would be the ideal solution.
> 
> But maybe a Saved Search could be a workaround.
> I am quite sure it would be OK if the user could see and change the
> properties of the Saved Search.
> 
> But I could not figure out how to edit a Saved Search myself yet 🙃
> 
> Is there a way to edit a Saved Search?
> 
> cheers,
> Torsten
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Alex Zavatone via Cocoa-dev
Is it reasonable to use an AppleScript to do it?

Back in the olden days, I used AS-OC to automate Illustrator, Photoshop, the 
Finder, TextEdit and ImageOptim all in one compiled application.
 
AS-OC is AppleScript-Objective-C

Cheers,
Alex Zavatone

> On Dec 13, 2022, at 2:22 PM, Rob Petrovec via Cocoa-dev 
>  wrote:
> 
> Is it always going to be the same search?  If so, you could create a Saved 
> Search in the Finder and include it with your app.  Then when you want to 
> bring up the search you can open the Saved Search bundle and it will open in 
> the Finder.  Hope that helps.
> 
> —Rob
> 
> 
>> On Dec 13, 2022, at 1:10 PM, Torsten Curdt via Cocoa-dev 
>> mailto:cocoa-dev@lists.apple.com>> wrote:
>> 
>> I would like to open a Finder window with a pre-filled search filter and
>> search results - but I just cannot find a good way to do it. I tried to
>> find a way through the Scripting Bridge but it seems like this is not
>> exposed at all.
>> 
>> Any other suggestions?
>> 
>> cheers,
>> Torsten
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com 
>> 
>> 
>> This email sent to petr...@mac.com 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> )
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
> 
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com 
> 
> 
> This email sent to z...@mac.com 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Steve Mills via Cocoa-dev
> On Dec 13, 2022, at 14:11, Torsten Curdt via Cocoa-dev 
>  wrote:
> 
> I would like to open a Finder window with a pre-filled search filter and
> search results - but I just cannot find a good way to do it. I tried to
> find a way through the Scripting Bridge but it seems like this is not
> exposed at all.

Is it not enough to use NSWorkspace’s showSearchResultsForQueryString?

Steve via iPad

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
Thanks for the help, Rob

Is it always going to be the same search?  If so, you could create a Saved
> Search in the Finder and include it with your app.  Then when you want to
> bring up the search you can open the Saved Search bundle and it will open
> in the Finder.  Hope that helps.
>

I was hoping to pass it in so that search parameters are still accessible
to the user.
Basically the same as CMD+F and entering some search parameters.
That would be the ideal solution.

But maybe a Saved Search could be a workaround.
I am quite sure it would be OK if the user could see and change the
properties of the Saved Search.

But I could not figure out how to edit a Saved Search myself yet 🙃

Is there a way to edit a Saved Search?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Rob Petrovec via Cocoa-dev
Is it always going to be the same search?  If so, you could create a Saved 
Search in the Finder and include it with your app.  Then when you want to bring 
up the search you can open the Saved Search bundle and it will open in the 
Finder.  Hope that helps.

—Rob


> On Dec 13, 2022, at 1:10 PM, Torsten Curdt via Cocoa-dev 
>  wrote:
> 
> I would like to open a Finder window with a pre-filled search filter and
> search results - but I just cannot find a good way to do it. I tried to
> find a way through the Scripting Bridge but it seems like this is not
> exposed at all.
> 
> Any other suggestions?
> 
> cheers,
> Torsten
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
> 
> This email sent to petr...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
I would like to open a Finder window with a pre-filled search filter and
search results - but I just cannot find a good way to do it. I tried to
find a way through the Scripting Bridge but it seems like this is not
exposed at all.

Any other suggestions?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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

2022-12-13 Thread Steve Mills via Cocoa-dev
> On Dec 13, 2022, at 13:50, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I am not interested in detecting whether or not my screensaver is running in 
> System Prefs preview.
> 
> I am interested in the *screen* on which I am running, irrespective of 
> whether it's inside System Prefs or as a fullscreen screensaver.

Maybe you *should* be, because the user can easily drag the System Prefs window 
to a different screen than the one it started on, which will screw up whatever 
you’re doing.

Steve via iPad

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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

2022-12-13 Thread Gabriel Zachmann 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.
>
>

I am not interested in detecting whether or not my screensaver is running in 
System Prefs preview.

I am interested in the *screen* on which I am running, irrespective of whether 
it's inside System Prefs or as a fullscreen screensaver.

Best regards, Gabriel


>> On Dec 11, 2022, at 14:56, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>>
>> ?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];
>>   NSUInteger idx_of_screen = [NSScreen.screens indexOfObject: 
>> window_.screen];
>>   displayID_ = [NSNumber numberWithUnsignedLong: idx_of_screen ];
>>
>>
>> On my Mac this runs fine, and I get a proper idx_of_screen/displayID_;
>>
>> However, one of my users sent me a log file, which shows that on his Mac, 
>> [self window] is non-null, but indexOfObject: returns NSNotFound, in the 
>> case where my screensaver is running in the preview of System Preferences.
>> (One difference between the systems is that I am still using macOS 12, while 
>> he is using macOS 13.)
>>
>> I guess, there is not much I can do about it, except find some kind of 
>> work-around for those cases, where this happens. Right?
>
>
> --
>
> Subject: Digest Footer
>
> ___
>
> Cocoa-dev mailing list  (Cocoa-dev@lists.apple.com)
>
> Do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins (at) lists.apple.com
>
> https://lists.apple.com/mailman/listinfo/cocoa-dev
>
>
> --
>
> End of Cocoa-dev Digest, Vol 19, Issue 65
> *



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com