Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [macos]

macOS (formerly known as OS X or Mac OS X) is the desktop operating system from Apple, found on Macintosh computers.

5
votes
1answer
49 views

Java program that relaunches itself in OS's terminal application

I wrote a Java program that when its executable .jar is opened manually, it re-opens itself inside the operating system's shell console. The purpose of this is to have a C#-style console application ...
1
vote
2answers
51 views

Drawing graphics and text using macOS Core Graphics

I have a small python project, which draws graphics and text onto a graphics context using MacOS's Core Graphics APIs. The idea is to make it easy for the user to write a few short lines, in order to ...
1
vote
1answer
27 views

Mac Bash: how to combine the open and str subtract to one line code? [closed]

new to bash , I use the following code to open the super folder with a file path. function openUp(){ cd $(echo $1 | sed 's@\(.*\)/.*@\1@' ); open .. } like ...
8
votes
4answers
1k views

Reporting new USB storage devices on Linux and macOS with Python

Synopsis: I wanted something for macOS (and Linux; maybe eventually Windows) that would simply wait for the user to connect a storage device and automatically select, or otherwise output the ...
1
vote
0answers
137 views

Alt-Coin Wallet QT Project for Mac OS-X

I was told my QT Project file is a hot mess. I'm returning to C++ after many years of doing Java and I'm really new to QT. I would like someone familiar with QT Project files to give my code a once ...
5
votes
1answer
2k views

File path unified in Windows/MacOS/Linux

We are all tremendously happy about back slashes in Windows file systems and do not think that their sole purpose is to make life complicated for smart people who are capable of using different OS. ...
4
votes
0answers
65 views

appleseed command line widget (CLW)

─── appleseed on GitHub appleseed v1.0.0 is a command line widget (CLW), I designed for macOS and iTerm2. Its a flexible platform for process automation and added eye candy. It utilizes ...
2
votes
1answer
67 views

Check SMART status on MacOS and pop up alert

So I don't know much about bash scripting. I am just a beginner. I made this script which checks the SMART status of my root volume and if it is failing then it immediately throws a pop up alert if ...
3
votes
2answers
59 views

Password string generation

I'm trying to create passwords using the following snippet to match a custom password policy. I've added three gtr statements, at the end of the string, to ...
3
votes
2answers
254 views

A C++ wrapper for Apple CoreFoundation

The wrapper makes it easy to manage memory when using CoreFoundation objects. It aims to act like a simple shared_ptr. Here is a usage example: ...
8
votes
1answer
77 views

Spoofs MAC Address to manufacturer of user's choice, Linux or MacOS

I've made a BASh script for Linux/MacOS that allows you to search for a MAC manufacturer and then generates a MAC address from that company and then spoofs it to that using ...
7
votes
2answers
216 views

Script to temporarily drop admin privileges

Description The aim of my project is to allow administrators to drop privileges for reasons of self-control. Currently, it works only on MacOS Sierra but the concept should be extensible to any Unix ...
3
votes
0answers
162 views

Find MIDI devices with certain names and make them usable

I'm working on a Swift app for macOS, where I take input from MIDI devices and transform that input. The MIDI devices being supported come in for flavors. What my code does is scan for MIDI devices, ...
4
votes
2answers
58 views

Create and open a file to take lecture notes depending on day and time

I am just wondering what, if any, more elegant ways might exist to write a script to accomplish the task that the script below accomplishes. The script works, so I don't need it to be debugged, but I ...
4
votes
1answer
109 views

Bash manual page selection menu (version 3)

This is an interactive script for selecting and reading the manual pages from the terminal command line. This is the 3rd version of this script. If you want to see the evolution of this script, follow ...
3
votes
0answers
43 views

Bash manual page selection menu (version 2)

This is update to a previously asked question Bash manual page selection menu. This script generates a menu for the user to select which manual page he/she would like to read. ...
6
votes
2answers
84 views

A replacement for OSX's path_helper

I was having problems setting my path the way I wanted, I turned to Apple's path_helper but found it appends system dirs to the beginning of the path. I found someone had made a start on a replacement ...
4
votes
0answers
44 views

Selective Time Machine backup deletion

Time Machine is a useful backup service for Mac, but deleting multiple backups is cumbersome. This script allows mass deletion of unwanted backups while allowing specified "important" backups to ...
2
votes
1answer
2k views

Listening to IOKit events with Swift 3

This is my first program in Swift/Xcode. The full source code and xcode project is available in GitHub. The part I would like reviewed is IOKeyEventMonitor.swift. ...
3
votes
1answer
70 views

Random password generator sh script

Yesterday, I was bored and decided to write a random password generator. At first it used numerous temporary files, changed that by using arrays. This was written on OS X and should work on Linux ...
11
votes
4answers
511 views

Simple CodeReview Questions Notifications for OSX

Some days ago, I figured out that I'd like to get a notification every time a new question is asked here. So, I've made a really simple Python script, which uses ...
2
votes
2answers
82 views

Opening programs from a simple spot

This is a simple program that opens programs from a simple spot: ...
4
votes
2answers
106 views

MacPorts - Quick Install Script

I wrote this script to automatically install the relevant version of MacPorts. It's supposed to be used in a fashion similar to the official installer for HomeBrew. FYI: The real reason that I ...
5
votes
2answers
472 views

Mounting a disk with the DiskArbitration framework

I have the following code that makes use of the DiskArbitration framework to mount a disk to its default location: ...
1
vote
1answer
1k views

Python implementation of Netcat, new design

I've made a simple netcat in Python and would appreciate any advice/opinions of how I've implemented it. test.py: ...
1
vote
1answer
140 views

Resolving the path to a Bash script

I wrote a function to resolve the full path to the current Bash script, and I'm wondering if it's SOLID: ...
4
votes
1answer
79 views

Search and merge split-archive backup parts

I wrote some code which searches parts of a split-archive backup (it's an Android backup, I used flashfire to backup) and rejoins them. As you can easily see, I've achieved this by ...
4
votes
1answer
106 views

Auto move files to a sub folder with Ruby

I started writing a script to handle my file downloads in osx because they quickly pile up and it gets time consuming to do this manually by drag and drop. I am looking forward to get some feedback. <...
1
vote
2answers
146 views

Lower the volume of my computer over time in Python

I wrote a program to gradually lower the volume of my computer when I go to sleep so I can fall asleep with TV or music on. This was my first time using argparse and I feel like there should be a ...
3
votes
0answers
5k views

Multiple View Controllers in a Single Window (Swift on OS X)

As an exercise I want to have a single window application (in Swift on Mac OS X) with 4 views, each controlled by an independent view controller and have their own XIB file. I have working code, but I ...
3
votes
1answer
139 views

Looking for identical files (or directories) in a filesystem

Dilemma The code below is in its infancy, but for now is an effort to crawl my entire file system and find duplicates whilst adhering to a variety of exclusion criteria. My current strategy for ...
5
votes
2answers
140 views

SSH chatting tool

I have taught myself some bash and already knew some AppleScript, so I have come up with this SSH chatting tool for OS X users. It allows you to chat from a terminal to another OS X computer. One ...
2
votes
2answers
2k views

Frontmost window of the current application that passes a predicate check

After resigning active state (going to the background), the mainWindow property of the main window in the app returns false. Nevertheless, I need a to find that ...
7
votes
1answer
21k views

Pure Swift solution for socket programming

I have spend quite some time now to find out how exactly to do socket programming in Swift (Xcode 6.1). There are a few examples out there, but most of them no longer work for the latest release of ...
6
votes
1answer
107 views

Reading OS X file tags

I'm investigating Go for use in our internal network / office project management system, and need a way to check and edit the color tags that you can set in Finder on files or folders (extended ...
6
votes
1answer
4k views

Timer UI-updating implementation for educational purposes

I thought it would be helpful to put together an example of what I'm talking about in the second part of my answer to this Stack Overflow question. The idea is that there's some data that is updated ...
3
votes
1answer
564 views

Bash functions to run/manage MySQL, Redis, Sidekiq, Rails server

I'm working with a Rails app that requires a few layers of infrastructure to run: MySQL, Redis, Sidekiq, and (of course) the Rails server. I wrote some functions to help me manage the various servers (...
5
votes
1answer
3k views

Python script using distutils to copy files on a Mac

I have a Python script I have written to copy files to a mounted Windows SMB share on a Mac. ...
5
votes
1answer
4k views

Presenting modal dialogs from XIB in Cocoa: best/shortest pattern?

Below is my typical WindowController module for presenting a modal dialog (could be settings, asking username/password, etc) loaded from a XIB. It seems a bit too complex for something like this. Any ...
10
votes
1answer
4k views

Canonical Implementation of a Subclass of NSOperation

I would like to develop a kind of template or canonical implementation for a concurrent subclass of NSOperation. Edit: there is a related request which implements ...
4
votes
1answer
235 views

Change whether file is executable

This is a cocoa app that adds a right click menu option to change whether a file is executable. It works by executing the system command chmod on each of the files. ...
2
votes
1answer
1k views

Reviewing C function which captures the screen

I have created a function in C on OSX in Xcode which captures the screen, adds the mouse pointer to the image, rescales the image to fit a certain width X height requirement, and puts the rescaled ...
4
votes
1answer
506 views

AppleScript to close running processes

I've been trying to emulate MS Windows behavior on my OS X and close processes that do not have a window. What I'd really like to do is "quit" the process on clicking the red "x" button. Instead, I'...
3
votes
2answers
473 views

Shell script to copy video files to another folder

I recently started running but hate running both in the quiet and with music, so i've been listening to podcasts. Unfortunately, I've caught up with all my favorites and so I've started listening to ...