#StackBounty: #windows #macos #macros #autohotkey #applescript Can AppleScript detect if a text entry field is active/focused within an…

Bounty: 50

I have a number of shortcuts that I am using via QuicKeys and AppleScript to perform various functions in a focused application. Certain shortcuts, such as individual alphanumeric keys and the spacebar, should be disabled and function for text entry when a text input field is focused.

I’ve figured out how to disable shortcut functionality when certain application windows are focused (by name matching). But is there any way via AppleScript to detect when the active focus is a text input field?

If so, this would greatly simplify my script, since the list of windows that have one or more text input fields that I could potentially click in is getting unwieldy to keep track of and manage.

BONUS POINTS: This is actually a cross-platform issue. On Mac, I’m solving it using QuicKeys macros with AppleScript, and on PC I’m using AutoHotkey and Pulover’s Macro Creator. So if anyone also knows how to detect if a text input field is active/focused using either AHK or PMC as well, please let me know and claim the title of Cross-Platform Macro-Functionality Wizard! ๐Ÿ™‚


Get this bounty!!!

#StackBounty: #macos #command-line #bash #daemon #at MacOS – "at" command is not working

Bounty: 50

I’ve started the atrun daemon using the following command.

$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

Added my username to /var/at/at.allow file.

$ cat /var/at/at.allow
myusername

And created a job using at command.

$ at now + 1 minute
touch /tmp/x.log
^D
job 1 at Fri Jan  1 09:56:00 2021

I can see the job scheduled using atq command.

But I can’t see the file /tmp/x.log created after the scheduled time. Is there anything I’m missing here or is there a way to debug this issue?


Get this bounty!!!

#StackBounty: #macos #environment-variables #gui How to set environment variables on MacOS using a GUI?

Bounty: 250

I’m trying to provide instructions to several people on how to set an environment variable in MacOS.

I want the variable to be permanent, not require reboot, and it must work for all gui applications.

Unfortunately, any solution that requires vim or even nano isn’t going to fly.

How exactly can this be done only using a gui application? (And the simpler the better)


Get this bounty!!!

#StackBounty: #macos #updates #macos-mojave #temporary-files #macos-bigsur After a failed Big Sur Update, of 17GB that was previously a…

Bounty: 50

I had 17BG of free before triggering Big Sur update from System Prefrences > Software Update > Upgrade Now. Midway through that process I shut the lid of my MacBook the update to fail. It says something likeL: โ€œUpdate failed due to network issues.โ€

Which makes sense, since the network does not stay connected when put to sleep.

The problem is when I check my MacBook now, only 5GB remains free. This 5GB of free space remains the same even after multiple restarts.

I doubt re-downloading is wise; the download GUI indicates that the download starts from scratch. I have hence not tried this.

However, before starting the update for the first time around it would refuse unless at least 15.95GB was free, and now it shows no such warning.

It is most likely that the update stored as temporary file(s) while downloading. But if so, restarting should clear out the temporary files since โ€” as I understand it โ€” a shutdown/restart involves deletion of temp files, yes?

Seeing as there is no change in the amount of free space after restarts, what can I do next?

Is there any command to purge these update files?


Get this bounty!!!

#StackBounty: #macos #updates #macos-mojave #temporary-files #macos-bigsur Big Sur Update Problems , After Update Fails, Space is Still…

Bounty: 50

How We Got Here :

17 GiB free before triggering Big Sur update from System Prefrences > Software Update > Upgrade Now .

Mid-way , I get up, shutting the lid , causing update failure. It says update failed due to network issues (not the exact message).

This makes sense ; it does not stay connected when put to sleep.

The Problem :

Only 5 GiB remains free. This arrangement remains unaltered even post multiple restarts.

I doubt re-downloading is wise; the download GUI indicates that the download starts from scratch. I have hence not tried this.

However, before starting the update for the 1st time it would refuse unless at least 15.95 GiB was free, and now it hoots no such warning.

My Theory :

Likely that update is stored as temporary file(s) while downloading. But if so, restarting should restore it – in Unix a shutdown/restart involves deletion of temp files, yes ?

The Question :

Seeing as there is no change in the amount of free space through restarts, what do I do ? Any command to purge these update files ? Anyone with similar experience ?


Get this bounty!!!

#StackBounty: #macos #macos-mojave If you had a Mac that was not going to ever connect to the internet, what would you do to optimize it?

Bounty: 50

I have a Mac Pro at work in a lab environment that is connected to a bunch of lab equipment that will never be connected to the internet. I’ve noticed that if I open up the console application to look at the streaming logs, there a lot of errors (which look mostly like the Mac is trying to call out to the internet and failing). While this doesn’t really matter, I was wondering what settings you would apply to optimize a Mac like this (e.g. disabling OCSP checks, etc.)

Disclaimer, I a more of a Windows/Linux user so assume very little Mac knowledge!

Cheers!

Edit: The Mac is on a network and wifi has been disabled.


Get this bounty!!!

#StackBounty: #macos #hard-drive #partition-recovery #merge #macos-mojave How to merge empty partitions to main partition without data …

Bounty: 50

I tried to install Windows in my MacBook Pro (13-inch, Mid 2012) having macOS Mojave. Tried without the bootcamp assistant as directed in the link –
https://fgimian.github.io/blog/2016/03/12/installing-windows-10-on-a-mac-without-bootcamp/

But after re creating the partition as mentioned in the link above, and after the starting of the installation, an error popped up saying – "We couldn’t create a new partition or locate an existing one."
Upon trying to find out a possible solution, I came across –
https://www.reddit.com/r/bootcamp/comments/3t7yai/we_couldnt_create_a_new_partition_or_locate_an/
As I was stuck, the last link having lots of successful results made me understand that I need to have all the partitions combined back to one. Reset the PRAM, and then do the same steps.

To get all the partitions to one, I deleted the ones that showed during the Windows Installation, and formatted them, as the unformatted ones, did not show up in the macOS.

But even after the formatting, the partitions did not show as active in the "Disk Utility", and showed error either upon mounting, restoring or Erasing.

I am tired of trying to install Windows, as there is some or the other error. I have somehow preserved my MacOS thankfully.

I just want to know how can I get back all the partitioned drives into the main drive as free space.

The combined screenshot of the partitions is below :
enter image description here

And About This Mac shows the storage as below :
enter image description here

I still have the Windows 10 bootable USB.Do I need to delete(and format) partitions from there first?
Any help is greatly appreciated.


Get this bounty!!!

#StackBounty: #ios #macos #video #safari #webrtc How to record audio and video in safari browser in iOS devices and Mac OS devices?

Bounty: 200

Stuck with the implementation to Record Audio & Video in safari browsers.

What I have tried:

I tried using WebRTC to get access to the Microphone and Camera, I was able to show the permissions but I’m unable to get access to the devices. Below is my code:

navigator.mediaDevices.getUserMedia = function(constraintObj) {
                                let getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia;

I keep getting the below error messages:

getUserMedia is not implemented in this browser

Can't find variable: MediaRecorder

I was able to record a video from iPhone using the below code, but the same code doesn’t work for audio.

<input id="recordUploadFile" style="visibility:hidden;" class="recordFile" type="file" accept="video/*" onChange='getFileNameWithExt(event, "record")' capture>

Unable to figure out below 2 cases:

  • iOS devices – Audio Recording
  • MacOS – Video and Audio Recording


Get this bounty!!!

#StackBounty: #ios #macos #core-data Sharing model between documents in a document-based app

Bounty: 50

My app is a document-based and uses NSPersistentDocument to manage its Core Data stack.

It works great when each document has its own data, but now I want documents to share parts of their model.
In my case, the users import large files and I don’t want to copy them for each document.

I want to have a model that is tight to the app itself and not to the particular document.

I’m not really sure how to go about it. NSPersistentDocument provides some methods to override for configuring Core Data stack but I don’t know how to set it up.
Can anyone give me some tips how to achieve that?


Get this bounty!!!

#StackBounty: #macos #emacs #visual-studio-code #comments Adding Emacs-style trailing line comment in Visual Studio Code

Bounty: 50

I am trying to replicate a standard comment shortcut from Emacs in Visual Studio Code (MacOS).

In Emacs, the shortcut M-; adds a trailing line comment to the current line. I use this shortcut quite a lot to comment on parts of the code.

For example, when editing a Matlab script in Emacs, the code

A=2*pi*radius;

becomes after pressing M-;

A=2*pi*radius;                          % |  

where | is the position of the cursor. Is there any way to replicate this behaviour in Visual Studio Code?


Get this bounty!!!