Sandboxing for .saver bundles changed in Security Update 2021-005 ?

2021-09-15 Thread Gabriel Zachmann via Cocoa-dev
I am getting a few reports by users of my .saver screensaver bundle that my screensaver no longer works under macOS Mojave 10.14.6. It used to work, so i was wondering if there have been any changes with the sandboxing, perhaps in the latest Security Update 2021-005, wrt. screensavers ? Any

Re: App can't be opened

2021-09-15 Thread Gabriel Zachmann via Cocoa-dev
Thanks so much! I guess that missing symbol explains the crash. BTW: is it possible, to make Xcode produce an error message when I am using symbols that are not available on the deployment target? (unless they are guarded by @available() ...) Best regards, Gabriel > On 9. Sep 2021, at 20:30,

App can't be opened

2021-09-09 Thread Gabriel Zachmann via Cocoa-dev
I have compiled my app for macOS 10.12, because one user runs macOS 10.13. Now he reports that he gets the error message "app can't be opened due to a problem" (the err message is in German, but I guess this is what it would say in English.) The error message does NOT say ".. unidentified

Re: Accessing a property of a view via its controller doesn't work

2021-09-07 Thread Gabriel Zachmann via Cocoa-dev
> > I asked earlier, but I’ll ask again: why are you doing this? NSView already > has a `window` property that provides its window. I agree, I guess, I should just remove this ivar. smime.p7s Description: S/MIME cryptographic signature ___

Re: Accessing a property of a view via its controller doesn't work

2021-09-06 Thread Gabriel Zachmann via Cocoa-dev
> > Forgot an @synthesize? We haven’t needed to do that since Xcode 4.2. > > Do you know why you needed to do that? It seems pretty much like an edge > case. > Good question. I had assigned the window to an ivar window_ in viewWillMoveToWindow: - (void) viewWillMoveToWindow:

Re: Accessing a property of a view via its controller doesn't work

2021-09-06 Thread Gabriel Zachmann via Cocoa-dev
you all. > On 4. Sep 2021, at 20:06, Ben Kennedy wrote: > > >> On Sep 4, 2021, at 10:27 AM, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> I access the window of a view by two different ways, in the controller and >> in the view, resp., and in the

Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Gabriel Zachmann via Cocoa-dev
I access the window of a view by two different ways, in the controller and in the view, resp., and in the controller, I always get a nil pointer. In my app, I have a subclass of NSView, MyView, declared like this: @interface MyView : NSView { NSWindow * window_; ... } @property

Archive for "Any Mac" automatically ?

2021-08-28 Thread Gabriel Zachmann via Cocoa-dev
Would it be possible to make Xcode settings such that Xcode will automatically use the "Any Mac" destination, i.e., compile a universal binary, whenever I "Archive" my macOS app? (The "Archive" version is, of course, intended for distribution.) Best regards, Gabriel smime.p7s Description:

Re: Getting notification when Facetime call comes in

2021-08-24 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! > Not sure if that work, but at least, you should try to use the right > Notification Center. > NSWorkspace Notification Center is only used to broadcast NSWorkspace > notifications. I tried it , but it did not work either. > >

Getting notification when Facetime call comes in

2021-08-23 Thread Gabriel Zachmann via Cocoa-dev
In my macOS app, I'd like to get notified if and when a FaceTime call comes in. I thought I could get these notifications with code like this: - (void) applicationDidFinishLaunching: (NSNotification *) aNotification { NSNotificationCenter *nc = [[NSWorkspace sharedWorkspace]

Re: "A build only device cannot be used to run this target" appearing with "Any Mac" scheme

2021-08-23 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the clarifications and insights! Best, G. 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

Re: "A build only device cannot be used to run this target" appearing with "Any Mac" scheme

2021-08-23 Thread Gabriel Zachmann via Cocoa-dev
Hi Matt, thanks a lot for your quick response. It clarifies a few things .. but see below. > > That pop-up actually has two halves: first, a scheme, and second, a run > destination. > > “Any Mac” and “My Mac” are run destinations, not schemes. But, as you’ve > seen, “Any Mac” is a special

"A build only device cannot be used to run this target" appearing with "Any Mac" scheme

2021-08-23 Thread Gabriel Zachmann via Cocoa-dev
I have a screensaver that compiles and runs fine when I use the active scheme "My Mac". However, when I switch to "Any Mac (Apple Silicon, Intel)", I get the error message "A build only device cannot be used to run this target" in Xcode immediately. Maybe, the following info is related to

Best way to grey out a status item's image?

2021-08-22 Thread Gabriel Zachmann via Cocoa-dev
My status item uses an image as icon like this: let itemImage = NSImage(named: "schinkel_icon") itemImage?.isTemplate = false statusBarItem_.button?.image = itemImage I would like to make this image grey (usually it is colorful) in cases when the status item is paused.

Re: How to distinguish between different MS Teams statuses

2021-07-23 Thread Gabriel Zachmann via Cocoa-dev
>> So far, i have been checking whether or not MS Teams is running by the >> following snippet (omitting some of the safety guards): > > That code is answering the wrong question. It might appear to provide the > state of some running apps, but all it actually does is indicate the presence >

Re: How to distinguish between different MS Teams statuses

2021-07-23 Thread Gabriel Zachmann via Cocoa-dev
> It seems that it would be tough. How can you check if it’s happening in a > browser? yes, any video conferencing via browser is pretty much undetectable , I guess. That is OK. I would be happy if I could detect some of the more common video conferencing tools. With Zoom, Webex, and

How to distinguish between different MS Teams statuses

2021-07-22 Thread Gabriel Zachmann via Cocoa-dev
My questions is quite simple: is it possible to determine - in my own app - whether or not there is an MS Teams video call taking place at the moment? So far, i have been checking whether or not MS Teams is running by the following snippet (omitting some of the safety guards): let mainScreen =

Re: Distributing Mac App to Registered Devices

2021-06-27 Thread Gabriel Zachmann via Cocoa-dev
>> >> Notarize your beta builds, just like you should be doing with your release >> builds. > > Yes, that is what I do now. However when upgrading to Xcode 12 it wants to > change the debug and release configuration to use development signing. > Notarized builds are reserved for archiving.

Re: Simplest way to produce "tick" system sound?

2021-06-11 Thread Gabriel Zachmann via Cocoa-dev
> > System Preferences > Sound > Sound Effects allows users to choose the alert > sound they prefer. > > It won?t necessarily be Tink for all users. > > If you want to play the sound that a user has chosen, you can use NSBeep() > or, in Swift, NSSound.beep() > Good point - thanks! Best

Re: Simplest way to produce "tick" system sound?

2021-06-11 Thread Gabriel Zachmann via Cocoa-dev
Thanks , I think I have found it - it's called Tink.aiff in /System/Library/Sounds Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Simplest way to produce "tick" system sound?

2021-06-11 Thread Gabriel Zachmann via Cocoa-dev
Sorry for the stupid question: what would be the easiest way to produce that "tick" system sound signifying an invalid keyboard input? I am talking about the new system sound under "Big Sur" (macOS 11). I used to use [NSSound soundNamed: @"Funk"]; but that does not give me the typical "tick"

Re: Special question about NSOpenPanel

2021-05-30 Thread Gabriel Zachmann via Cocoa-dev
e time of the failure that could shed some light on what happened. > Good luck. > > —Rob > > > >> On May 25, 2021, at 1:06 AM, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> Yes, I am suspecting a bug in macOS , too, since exactly the same code works &

Re: Special question about NSOpenPanel

2021-05-25 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the hint! Is there an easy way to extract those logs? You know, I have to give the user simple instructions ... Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list

Re: Special question about NSOpenPanel

2021-05-25 Thread Gabriel Zachmann via Cocoa-dev
Yes, I am suspecting a bug in macOS , too, since exactly the same code works fine under 10.15.2+ Problem is, though, that the user says he cannot upgrade his macOS 10.15.0 to something higher. (don't know why) Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature

Special question about NSOpenPanel

2021-05-24 Thread Gabriel Zachmann via Cocoa-dev
I have a special situation where NSOpenPanel does not open a panel. The circumstances: My app is actually a screensaver, so it's run inside legacyScreenSaver. Also, it seems to occur only under macOS 10.15.0, and (perhaps) only for some users, not all. What happens is that [oPanel runModal]

Re: How to check signature and notarization?

2021-04-13 Thread Gabriel Zachmann via Cocoa-dev
ce where they >> unzipped the file. No problems with GateKeeper in over two years of >> Notarization so far. >> >> Jack >> >> >> >> >>> On Apr 12, 2021, at 10:48 AM, Sean McBride via Cocoa-dev >>> wrote: >>> >&

How to check signature and notarization?

2021-04-12 Thread Gabriel Zachmann via Cocoa-dev
I am distributing my app using a simple zip file. Now, I have a few users (only a few it seems) who get the error message ".. can't be opened because Apple cannot check it for malicious software" when they try to run it. I am pretty positive I did sign and notarize it before exporting the archive

Re: Several different NSUserDefaults in the same app?

2021-04-06 Thread Gabriel Zachmann via Cocoa-dev
> We don?t use NSUserDefaults in the app. Instead we have an > NSMutableDictionary that holds the settings, and we write them to a file when > they change. We read them in at app startup. > That allows us to actually have different settings for various items Yes, that certainly works. There

Re: Several different NSUserDefaults in the same app?

2021-04-04 Thread Gabriel Zachmann via Cocoa-dev
> > It appears you are trying to get NSUserDefaults to do something that Apple > doesn?t want it to do these days. Why not create your own defaults, > writing the data to a dictionary that is then written to a file that you save > in the ~/Library/Preferences folder, with a name of your

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
Oh, and BTW: what happens if I do this: NSDictionary * monitor_user_defaults = [ [NSUserDefaults standardDefaults] dictionaryForKey: displayName_]; [monitor_user_defaults setObject: anArray forKey: @"Pref1"]; Will that make NSUserDefaults automagically write the new preferences/defaults

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
> Why not use your top level NSUserDefaults as a dictionary and use each > monitor name as a key for each object in the dictionary? Is that too clunky? I was thinking of that, but I was hoping for a more elegant solution. With the dictionary-per-monitor your suggesting, I guess I would have

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
>> Can you explain to me, what is the difference between >> [[NSUserDefaults alloc] init] >> and >> [NSUserDefaults standardDefaults] >> ? >> I didn't get that from Apple's docs. >> > > > [...] > So it appears that using alloc int does not return the shared instance. Sorry for asking: the

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! > How about something like this? > > NSUserDefaults *monitor1 = [[NSUserDefaults alloc] init]; > [monitor1 setBool:YES forKey:@"MyKey”]; > > BOOL value = [monitor1 boolForKey:@"MyKey"]; So, where is the kind of monitor encoded? I mean, how does the

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
>> >> [ [NSUserDefaults userDefaultsWithName:@"monitor-name"] boolForKey:@"some >> key"] > > I thought -addSuiteNamed: would allow you to maintain/add a suite of defaults > for each monitor. Maybe. The doc says: """ The suiteName domain is similar to a bundle identifier string, but isn't

Re: Several different NSUserDefaults in the same app?

2021-04-03 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! > User Defaults are now stored in an opaque in memory DB, and while the various > files may still play a role, you can't make any assumptions about them > anymore. Yes, I understand that. > > That being said, [NSUserDefaults.standardUserDefaults

Several different NSUserDefaults in the same app?

2021-04-02 Thread Gabriel Zachmann via Cocoa-dev
I used to manage different NSUserDefaults in my app depending on which monitor it runs. So, I create filenames of the user defaults like this: NSString * defaults_name = [ NSString stringWithFormat:@"de.zach.MyApp.%@", displayname ]; Then I used to create the NSUserDefaults object with an

Re: Exception not being caught in try statement

2021-03-28 Thread Gabriel Zachmann via Cocoa-dev
I can't really answer your questions ... but just a dumb suggestion: have you tried removing all tabs from your RTF file? Best regards, Gabriel >> >> Any ideas what's going on? Other than the file not being found, why else >> might the object at line 3 in the backtrace be nil...and more

Re: Missing log output

2020-11-12 Thread Gabriel Zachmann via Cocoa-dev
> > Gabe, let me share the decisions and solutions I went over in my attempting > to solve this on iOS. Thanks a lot! (BTW: I am working on macOS.) > > In my first logging, all that I wanted was to be able to get the NSLogs out > of a file that ONLY had the logs from my app. I sent you the

Re: Missing log output

2020-11-10 Thread Gabriel Zachmann via Cocoa-dev
> > For logging, my old logging code was replaced by CocoaLumberjack A quick glance it it looks interesting. Do you know (off the top of your head) whether it puts log message into the general syslog? That would be nice because it would make it easy to look at the log message on my side using

Re: Missing log output

2020-11-09 Thread Gabriel Zachmann via Cocoa-dev
> At any rate, it's good to plan ahead and use a different logging mechanism, > one without all the complications and unknowns of the system log. Yes, I agree. I was thinking of implementing a way such that users can just click on kind of a "Send Log" button, and my app would filter out all

Missing log output

2020-11-09 Thread Gabriel Zachmann via Cocoa-dev
I have one user who has a problem with my Mac app (macOS Catalina), so I sent him a version that contains more log output. He has returned the log output, but, alas, it does not contain the new log output. In fact, it contains less output, even some lines are missing that I am outputting in the

How to parse a log file

2020-10-26 Thread Gabriel Zachmann via Cocoa-dev
From a user, I received a log file that contains an error (see below) and a stack trace of my macOS app. Is it possible to determine the exact line in the source code where the error occurred? Best regards, Gabriel Encl: excerpt from log. "ArtSaverApp" is my macOS app. 2020-10-23

How to refund a customer on mac app store?

2020-10-25 Thread Gabriel Zachmann via Cocoa-dev
Is it possible to give a refund to a customer who has bought my app on the Mac App Store? Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Throttling drawing to vertical refresh

2020-10-23 Thread Gabriel Zachmann via Cocoa-dev
> >>> So is there a convenient way to throttle drawing to the monitor's refresh >>> rate or does this have to be done the hard way by querying the monitor's >>> refresh rate and then setting up a timer which draws in exactly those >>> refresh intervals or how should this be done? > >>> Note

Re: App store question regarding Big Sur

2020-09-20 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your insights and recommendations. As you probably have already guessed, I am pretty new to the MAS. So, here is another newbie question: when I upload a new version of my app that runs under Big Sur, which version will the Catalina users get? I am asking, because I imagine I

App store question regarding Big Sur

2020-09-18 Thread Gabriel Zachmann via Cocoa-dev
I've got an app on the Mac app store (MAS) which works under Catalina. My question is: when Big Sur becomes official, will my app also show up in the MAS for people who's Mac runs under Big Sur? I'm asking because I haven't had the time to test my app under Big Sur, yet, and I probably won't

Re: Free trial period for apps in Mac App Store (?)

2020-09-01 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for sharing your insights! Very helpful! Best regards, Gabriel 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

Re: Free trial period for apps in Mac App Store (?)

2020-09-01 Thread Gabriel Zachmann via Cocoa-dev
> Make a ?Lite? version free (Price 0.00) which has either a limited life span > or limited functionality or both. > [...] > The other option is to use ?In App Purchases? to upgrade the functionality. > Thanks a lot for your response. Option 1 would mean, in my case: develop and maintain two

Free trial period for apps in Mac App Store (?)

2020-08-27 Thread Gabriel Zachmann via Cocoa-dev
The App store Review Guidelines mention this: "Non-subscription apps may offer a free time-based trial period before presenting a full unlock option". I have followed the links in that paragraph but that did not help me understand how that works. Can some kind soul please point me to

Strange error when resolving a security-scoped bookmark

2020-08-23 Thread Gabriel Zachmann via Cocoa-dev
I have a strange error when resolving a security-scoped bookmark (SSB) in my screensaver. The code works fine for almost all users (even under Mojave), except for one user under Mojave (10.14.6). Here is the code in question: NSError * error; BOOL isStale = NO; NSURL *

Re: Question about Info.plist's

2020-08-20 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for everyone's insights and suggestions! For the record: I have now shed a bit of old baggage in my code. (I did the version management and the build number incrementing too cumbersome; I must have picked up the CFBuildNumber somewhere 14 years ago ...) Anyways, I am now using the

Re: Question about Info.plist's

2020-08-20 Thread Gabriel Zachmann via Cocoa-dev
> https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364 > : Thanks a lot! The CFBuildVersionNumber seems to be very restrictive :-( """ While developing a new version of your app,

Re: Question about Info.plist's

2020-08-19 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the insights. > On 19. Aug 2020, at 18:44, Glenn L. Austin wrote: > > No, you can't use an "earlier" key to create a "later" value - but you can > use code to do basically the same thing. > > Or, you can use the same variable that sets your CFBuildNumber to set your >

Question about Info.plist's

2020-08-19 Thread Gabriel Zachmann via Cocoa-dev
Question: Is there a way to use a key/value that was defined earlier in the plist file to define a value for a later key? Explanation: I have a macOS project with an automatically created "About" window. The plist file has, additionally to all the default stuff, the key CFBuildNumber (with a

Re: AddInstanceForFactory: No factory registered for id

2020-08-19 Thread Gabriel Zachmann via Cocoa-dev
>> On Aug 18, 2020, at 10:33 AM, Gabriel Zachmann via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >> (I have already experimented with AudioServicesCreateSystemSoundID(), but >> failed.) > > In my experience, playing sounds (in macOS ap

AddInstanceForFactory: No factory registered for id

2020-08-18 Thread Gabriel Zachmann via Cocoa-dev
I am seeing this message in the log/console: ArtSaverApp[8638:9659238] [plugin] AddInstanceForFactory: No factory registered for id F8BB1C28-BAE8-11D6-9C31-00039315CD46 I think it is caused by my app playing a system sound. The code I use to do so is: const NSString * trash_sound_file =

Re: Funny issue: one line in GUI is grey-ish

2020-08-11 Thread Gabriel Zachmann via Cocoa-dev
> > NSPopover has a property `appearance`, whose docs say “If no appearance is > specified, the popover’s effective appearance defaults to `vibrantLight`”. > This got me wondering, what if we Thanks a million for your insights and your investigations! This seems almost like a bug in macOS to

Re: Funny issue: one line in GUI is grey-ish

2020-08-09 Thread Gabriel Zachmann via Cocoa-dev
alues? Of the text and of the label? Try > changing the color to something else and if it’s also lighter, then somewhere > you have a 50% alpha value. > >> On Aug 9, 2020, at 7:58 AM, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> I have a simple app (status bar ite

Funny issue: one line in GUI is grey-ish

2020-08-09 Thread Gabriel Zachmann via Cocoa-dev
I have a simple app (status bar item) with a simple GUI. The funny thing is that one text line in the GUI is grey-ish, but NOT in the XIB in XCode ... and I can't determine why that is or how to correct it. (It has the font "System Regular".) If you want to see it for yourself, here is a

Re: Finding all paths to copies of app ?

2020-07-16 Thread Gabriel Zachmann via Cocoa-dev
Cool! thanks a lot! Best regards, Gabriel > On 16. Jul 2020, at 18:01, Rob Petrovec wrote: > > You want LSCopyApplicationURLsForBundleIdentifier > smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list

Finding all paths to copies of app ?

2020-07-16 Thread Gabriel Zachmann via Cocoa-dev
Is there a way to find the paths/URLs to all app bundles that have the same bundle ID? I have a user who likes to make duplicates of my app (it does make sense, to some extent). So, in my launcher app, I'd like to to launch all of these copies. I have checked the docs on NSWorkspace and the

Crash due to missing entitlement ?

2020-07-13 Thread Gabriel Zachmann via Cocoa-dev
One beta tester of my simple status menu bar app has reported a crash. I sent them the signed and notarized app in a ZIP file. The beta user has sent a number of log lines extracted via Console. Here are the relevant lines (I think): error 19:37:00.542568-0400tccdPrompting policy for

Re: Detect video conference ?

2020-07-11 Thread Gabriel Zachmann via Cocoa-dev
> > If a user is video conferencing in a browser, why do you think that the user > would be flagged as idle? Have you tested this? Yes, when the user just participates in the video call, without any actions on his behalf, then the idle time increases continuously. I have tested it.

Detect video conference ?

2020-07-10 Thread Gabriel Zachmann via Cocoa-dev
Does anyone see any possibility to detect in an app, whether or not a video conference is going on IN A BROWSER? Background: i'm developing a status bar item app that launches another app when the user has been idle for some time. However, I do NOT want to launch that other app if there is a

Re: Confusion about System Preferences

2020-07-09 Thread Gabriel Zachmann via Cocoa-dev
> You're welcome! In the future, please reply to the list so the ongoing > discussion can benefit others. Sorry! usually, I do that , bit occasionally, when in a hurry, I forget to hold down the shift key when clicking CMD-R :'-) >

Confusion about System Preferences

2020-07-09 Thread Gabriel Zachmann via Cocoa-dev
I am confused about the way system preferences are organized (or preferences in general). I read the man page of defaults(1), but it is still unclear to me what happens when I do, for instance, defaults -currentHost read com.apple.screensaver idleTime as opposed to defaults read

Correct icon height in status bar?

2020-07-05 Thread Gabriel Zachmann via Cocoa-dev
I've got a status bar menu item, that has a bitmap image for an icon. I am creating the icon like this: statusBarItem_ = statusBar.statusItem( withLength: NSStatusItem.squareLength ) let itemImage = NSImage(named: "schinkel_icon") itemImage?.isTemplate = false

Kiosk mode problems

2020-07-04 Thread Gabriel Zachmann via Cocoa-dev
I am trying to add a kiosk mode to my macOS application. However, I am running into problems. First of all, when I add this code to my AppDelegate: NSApplicationPresentationOptions presentationOptions = (NSApplicationPresentationHideDock |

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Gabriel Zachmann via Cocoa-dev
> > Otherwise, if sandboxing, refer to this discussion. > https://stackoverflow.com/questions/21956946/authenticate-user-objective-c-cocoa-sandboxing > > Thanks a lot for the link. After carefully

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Gabriel Zachmann via Cocoa-dev
> I was hoping to convey to the OP that the goals of this question might have > unintended consequences. I realize there might be security concerns with what I am trying to do. Is there a way to lock the screen such that the user has to provide their password to unlock it, and still have my

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Gabriel Zachmann via Cocoa-dev
Thanks! That seems rather what I need. Now, is there a way to check the user's password before my app quits or goes out of full-screen mode? Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Gabriel Zachmann via Cocoa-dev
Thanks for the hint. Can caffeinate be run such that it prevents ONLY the screensaver from kicking in, but does NOT prevent the system from sleeping? (I could not find that option in the man page.) Best regards, Gabriel > On 29. Jun 2020, at 04:28, じょいすじょん wrote: > > One way to do this is

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Gabriel Zachmann via Cocoa-dev
> but the header for that function says it can be replaced by > IOPMAssertionCreateWithName(). I haven’t looked at that in detail or used it > myself, but one of the defines for that function is > ‘kIOPMAssertionTypePreventUserIdleDisplaySleep’, which appears to do the same > thing as the old

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Gabriel Zachmann via Cocoa-dev
>> Does anyone know how to programmatically disable macOS from launching the >> screen saver on macOS? >> I would like to do that in one of my apps. > > Not sure in general, but in a managed host situation this type of system > modification could be disallowed by policy. Even admin users of a

Prevent screen saver from starting, but don't prevent computer sleep

2020-06-27 Thread Gabriel Zachmann via Cocoa-dev
Does anyone know how to programmatically disable macOS from launching the screen saver on macOS? I would like to do that in one of my apps. Note that I do NOT want to disable screen sleep, nor system sleep. I just want to set the idle time to "Never" , which you would do manually by going to

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-27 Thread Gabriel Zachmann via Cocoa-dev
s, Gabriel > > It’s possible that the “funk” sound is coming from the other app if it still > has keyboard focus. Try attaching to that instead and seeing if it hits > NSBeep. > > Saagar Jha > >> On Jun 25, 2020, at 02:09, Gabriel Zachmann via Cocoa-dev >> wrote:

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-25 Thread Gabriel Zachmann via Cocoa-dev
> > Set a symbolic breakpoint on NSBeep and see whether it?s your code that?s > calling it. > > Thanks a lot for the hint! I think I managed to do that (it's a bit tricky, since my app gets launched in fullscreen mode by some other app). Alas, the debugger did not break at any time when I

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Gabriel Zachmann via Cocoa-dev
> > Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s > calling it. > Thanks, but how would I do that? I never use NSBeep in my code .. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___

Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Gabriel Zachmann via Cocoa-dev
I have an app that should switch to fullscreen automatically, if it is launched with a specific flag. This is my code to switch to fullscreen at startup (in AppDelegate.m): - (void) applicationWillFinishLaunching: (NSNotification *) notification { [self.window setFrameAutosaveName:

Re: Launching another app with command line arguments

2020-06-21 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot to everybody for helping! I have tried a number of approaches. For the moment , I have settled for an app group container. Both apps are members of the same app group container. In that, app A creates a file with the flags, then launches app B, and B reads the flags file (if

Re: Launching another app with command line arguments

2020-06-21 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot. I tried this in my app A , but I keep getting the error message launch path not accessible together with a stack trace. I am getting the url to my app B like this: url_ = NSWorkspace.shared.urlForApplication( withBundleIdentifier: "de.zach.AppB" ) which points to

Re: Launching another app with command line arguments

2020-06-20 Thread Gabriel Zachmann via Cocoa-dev
> > Write stuff to location in file the other app knows about, then read it. > Interesting. Will that work with all the sandboxing? Can A create a file /tmp/info-for-B without any user intervention? Can B read it *and* delete it? smime.p7s Description: S/MIME cryptographic signature

Re: Launching another app with command line arguments

2020-06-20 Thread Gabriel Zachmann via Cocoa-dev
> > If app B can be treated as a sub-process of app A you can use Process. I > know that argument passing works with Process. Sounds good. How can A launch B as its sub-process? (and pass command line arguments?) smime.p7s Description: S/MIME cryptographic signature

Re: Launching another app with command line arguments

2020-06-20 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your reponse. Yes , it is sandboxed. ... Argh, the *last* line of the docs of configuration.arguments tell that those are ignored! :-( So, the new question is: is there any easy way how my app A can launch my app B and pass a simple piece of info from A to B, such as a

Launching another app with command line arguments

2020-06-20 Thread Gabriel Zachmann via Cocoa-dev
I would like to launch app B (developed by me) from app A (also developed by me). In app A, I do let configuration = NSWorkspace.OpenConfiguration() configuration.activates = true configuration.arguments = ["-f"] NSWorkspace.shared.openApplication( at:

Re: Status bar item icon is always black

2020-06-20 Thread Gabriel Zachmann via Cocoa-dev
> Why do you put the images in an asset catalog? I use PDFs a lot for icons, in my case, the "icon" is really a bitmap in the first place. (It is an image of a painting - I know, this is not the traditional look of icons.) > (in my case mostly as Template images). But I just drag them into a

Re: Status bar item icon is always black

2020-06-19 Thread Gabriel Zachmann via Cocoa-dev
I think, I solved the mystery. Just for the record, in case someone else stumbles across this (it's probably old news for you guys on this list): You can use a vector drawing in a PDF , drag it into the asset catalog (not into the default AppIcon!), and load it as if it were a regular image ,

Re: Status bar item icon is always black

2020-06-19 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! One question: do you have just one PDF file in the asset catalog? If so, in which "box"? (16x16, .., 256x256?) > > Our image is different in the following aspects though: > > 1. It's a vector image (PDF) > 2. In the asset catalog the Preserve Vector Data option

Re: Status bar item icon is always black

2020-06-19 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. For further info: this is what I have in Xcode: https://owncloud.informatik.uni-bremen.de/index.php/s/T9SrFWNTxRbW83S > Yeah, the isTemplate definitely shouldn't be set, that would cause that > issue, I'd have expected setting that to false to fix your issue.

Status bar item icon is always black

2020-06-17 Thread Gabriel Zachmann via Cocoa-dev
I am trying to define an icon for a very simple status bar menu item. My problem is that it appears always as black, or not at all, or grey-ish, depending on what I have tried, but not as intended. I have populated the asset catalog with icon images of all the required sizes that work fine in

Re: Launching another app from mine

2020-06-16 Thread Gabriel Zachmann via Cocoa-dev
> > NSWorkspace does this. Look at the launchApplication method. You can get the > app name from the bundle identifier using the NSWorkSpace > URLForApplicationWithBundleIdentifier method. Thanks! seems to work like a charm. Best, G. smime.p7s Description: S/MIME cryptographic signature

Re: Launching another app from mine

2020-06-16 Thread Gabriel Zachmann via Cocoa-dev
Sorry, macOS. Best regards, Gabriel > Mac, iOS, WatchOS, iPadOS? TRS-80 Basic? Which platform? > smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Launching another app from mine

2020-06-15 Thread Gabriel Zachmann via Cocoa-dev
I would like to launch application B from my application A using Swift. Both applications are created, compiled, signed, and notarized by me. Challenge: no user intervention should be necessary when launching B from A. Is that possible? Best regards, Gabriel smime.p7s Description: S/MIME

Re: Points vs pixels in a bash script

2020-06-10 Thread Gabriel Zachmann via Cocoa-dev
> > python -c 'import AppKit ; print > AppKit.NSScreen.screens()[0].frame().size.width' > Thanks a million! that even works for multi-monitor setups correctly. >> tells me the resolution of the screen in the same units (of course) as > > This will not work if you have multiple monitors

Re: Points vs pixels in a bash script

2020-06-10 Thread Gabriel Zachmann via Cocoa-dev
For the record: I believe I have found a solution: tell application "Finder" to get bounds of window of desktop tells me the resolution of the screen in the same units (of course) as tell application "System Events" to get the title of every window of every process lateron. Thanks again

Re: Points vs pixels in a bash script

2020-06-09 Thread Gabriel Zachmann via Cocoa-dev
> you're not taking into account the current screen resolution (a.k.a. display > mode). The user > [...] > necessarily have to build a C utility for it. You can invoke the Swift > interpreter to execute Thanks a lot for your hints, but unfortunately , I don't have the time to learn Swift

Re: Points vs pixels in a bash script

2020-06-09 Thread Gabriel Zachmann via Cocoa-dev
> In particular, you're not taking into account the current screen resolution > (a.k.a. display mode). The user can select different scaling for a Retina > display in System Preferences > Displays. Good point. I wasn't taking that into consideration. So, what would be a robust way to

Re: Points vs pixels in a bash script

2020-06-09 Thread Gabriel Zachmann via Cocoa-dev
> > I don’t have an answer to your question, but to add some clarity Points are > scale factor independent unit of measurement. On a retina display there are > 2 pixels per point. On a non-retina display there is 1 pixel per point. Say > Apple comes out with a display with a scale Thanks

Points vs pixels in a bash script

2020-06-08 Thread Gabriel Zachmann via Cocoa-dev
I know this mailing list might not be the perfect fit for my question, but maybe someone has an idea. I have a problem converting points (I think) to pixels in a bash script. I'd rather not write an extra C/Cocoa utility for that. Using system_profiler SPDisplaysDataType I can retrieve the

Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. > If that’s the case, why can’t you just load the next image from disk on a > background queue while That is what I'm doing, since loading the next image could take up to 9 seconds. > the current image is being displayed and not have to worry about memory usage

<    1   2   3   4   >