Automator takes screenshot of background instead of window - macos

System specs: mac OS Monterrey V12.5, Apple M1 chip 2020
I am making an application which will take a screenshot of a video, and take the timestamp of the current point in this video, after which both the timestamp and screenshot will be send to a numbers file (mac OS excel like program).
I could not find an application to do this and I tried to get it working using python as shown here but was unable to. Now because I am on Mac I have decided to use Automator instead. I am currently on the screenshot part and Automator has a build in screenshot functionality.
Unfortunately, this screenshot does not detect browser or application windows, it will only take a screenshot of my background.
I have no idea why this is but I suspect it might have to do with permissions related to the M1 chip.
I tried different monitors and simplyfying the automation to just taking a screenshot, but so far nothing has helped, I could not find others online who had a similar problem.
If there is any information missing from this post I will be happy to provide it.
Edit: It seems to be some kind of permission issue, automator CAN take screenshots within Safari, now I just need to find a way to do so in firefox.

I have solved the issue, it turns out that the M1 chip has a special permission for screen recording, adding my Automator application to this permission list will allow it to take screenshots of all windows.

Related

How to see Browser apps under Applications in Mac Terminal

I have been trying to find the "official" names of my browser apps (Chrome, Brave, Safari, etc.) as I was experimenting with opening different browsers from the command line.
I was able to figure out the name for Brave (brave\ browser) by perusing the internet but wanted to find a better way to list out ALL of my browsers by name in the command line. I found out how to find application by cd-ing into /System/Applications/ and then typing out ls like any other directory. It shows the below.
App Store.app Launchpad.app Reminders.app
Automator.app Mail.app Shortcuts.app
Books.app Maps.app Siri.app
Calculator.app Messages.app Stickies.app
Calendar.app Mission Control.app Stocks.app
Chess.app Music.app System Preferences.app
Contacts.app News.app TV.app
Dictionary.app Notes.app TextEdit.app
FaceTime.app Photo Booth.app Time Machine.app
FindMy.app Photos.app Utilities
Font Book.app Podcasts.app VoiceMemos.app
Home.app Preview.app
Image Capture.app QuickTime Player.app
I am curious how I can see other apps, such as Google Chrome.app, Brave Browser.app, etc. I can see them when I go to Applications via finder but I wanted to see how I can list in the terminal.
Thanks to #LMC and #Gordon Davisson I was able to find an elegant solution. It turns out since Catalina 10.15, Mac split up applications into two volumes:
/System/Applications
/System/Volumes/Data/Applications/
The first one basically houses all "system" applications; applications that are built in with the Mac OS. The second one houses user installed applications. It is in the second one where you can find your browsers.

Calling getUserMedia on Safari causes sound on mac os x to be silent for a second

As of Safari 11, they have started supporting WebRTC apis natively.
In my web application I am using navigator.mediaDevices.getUserMedia to get control of the microphone.
I noticed that, only in Safari, when my code calls getUserMedia, the sound on my computer gets low then comes back up to normal volume after a second.
I have tested this on another website: https://simpl.info/getusermedia/
When I loaded the website, I did not see the issue..
The site above only requests for video, but the code is very simple and not minified. I put a breakpoint right where it calls getUserMedia and added the constraint for audio and I was able to reproduce the issue.
Has anyone else had this problem? I am unable to find anything online describing this issue.
I am running Mac OSx El Capitan. I know I am out of date but people have told me that this happens on Sierra as well.
The same on High Sierra.
My guess is they try to avoid audio spikes or to go easy on the echo canceler.

How to debug Google Chrome (not Chromium) on OS X with source?

The "Warn Before Quitting" feature stopped working for me. When I click Cmd-Q Chrome closes immediately instead of showing me the "Hold ⌘Q to close" message.
I want to debug the code responsible for that, but I can't seem to find a way. On Windows I can attach to Chrome, get the PDBs from Google's symbol server, and get the appropriate sources using SrcSrv.
Is there anything similar on OS X?
(Firefox apparently has a script to download symbols for Linux/OS X, though I never tried using it.)
It doesn't happen on another user on my machine or on Chromium. I tried copying my profile to ~/Library/Application Support/Google/Chrome of another user and to ~/Library/Application Support/Chromium (for a Chromium build I made). In both cases the bug did not present itself (though other bad things have happened), so using Chromium doesn't seem like a solution.
(Although I did build Chromium's HEAD rather than the tag corresponding to the version of Google Chrome I'm running. Maybe if I do that I would be able to reproduce the problem in Chromium. Nonetheless the question remains.)
Is it possible to perform source debugging of Google Chrome on OS X? If so, how?
Note: I'm not interested in attempts to solve the "Warn Before Quitting" bug, suggestions to report it to Google, etc. That's not the point. I want to be able to debug Chrome myself.

How to bypass “Adobe Flash Player has stopped a potentially unsafe operation.” running on Mac 10.7 with local files

I am tearing my hair out. I have a complicated Flash player application which I want to run on my local Mac, 10.7.4. I set this up a year or so ago on earlier Mac OS, with earlier Flash players, and sometimes I had to fiddle with global settings, etc, but it always worked. But now flash has decided (sensibly) to handle the security settings surrounding this use of Flash from the local System Preferences. Here's the appropriate screen which should let me tell Flash that I am opening files in the folder:
You can see my desperate attempts to get flash to let me open files in /Users/peter/BTDE2/ etc -- all failing.
Why? How do I get around this? or do I just give up on flash as a horrible bad job...
It appears from the documentation at http://help.adobe.com/en_US/FlashPlayer/LSM/WS6aa5ec234ff3f285139dc56112e3786b68c-7ff0.html#WS6aa5ec234ff3f285139dc56112e3786b68c-7feb that there should be a fix. According to this, there should be a 'Developer Tools' control on the 'Advanced' panel, which gives access to 'Trusted Location' settings. Well, here is the Advanced panel in Flash System Preferences and it shows no such choices. Looks like someone screwed up somewhere.
In the Flash Player panel are you not able to scroll down to reveal the Developer Tools?

How do I use stackshot to debug my application?

I've recently been told about a useful debugging tool on Mac OS X called stackshot, however I don't know how to invoke it. My understanding from the documentation is that it runs as a daemon, but the man page also reads as if it can be invoked from the command line. How would I go about leveraging stackshot for my currently-running application?
sudo /usr/libexec/stackshot -i
Stackshot is intended for debugging system-wide issues (deadlocks etc), not single applications; as such it creates a stack dump of the entire system, not a single application.
With the default configuration, this will create a stack shot in /Library/Logs/stackshot.log
Apple has asked me to produce a Stackshot on my iOS device. To do so, when the issue occurs, simultaneously hold down and release the Home and a volume button.
Then, synch your device with iTunes.
After synching, your stackshot log file will be stored on the computer. I don't know where it is in Windows, but on a Mac it is in:
~/Library/Logs/CrashReporter/MobileDevice//stacks-yyyy-mm-dd-xxxxxx.log
stackshot no longer appears to be included with OS X, at least not in 10.11. However you can still take a sample of your app using the /usr/bin/sample tool.
This is also accessible using Activity monitor:
Open Activity Monitor
Double click your app
Click the Sample button in the bottom left corner
That will allow you to see what is currently happening in your app so that you can debug CPU usage issues without running the app from Xcode.

Resources