Last active
March 21, 2024 18:30
-
-
Save mpociot/ae7f4711ff4804d7ffab6a6aac4730c7 to your computer and use it in GitHub Desktop.
Python script to open Tinkerwell from your current working directory - tinkerwell.app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
RUN_PATH = '/Applications/Tinkerwell.app' | |
def process_args(argv): | |
args = [] | |
for i, arg in enumerate(argv[1:]): | |
path = arg | |
args.append('-path') | |
args.append(os.path.abspath(path)) | |
return args | |
def start_new_instance(args): | |
if len(args) > 0: | |
args.insert(0, '--args') | |
os.execvp('/usr/bin/open', ['-a', RUN_PATH] + args) | |
tinker_args = process_args(sys.argv) | |
start_new_instance(tinker_args) |
skydiver
commented
Oct 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment