Old 01-13-2018, 03:35 AM   #1
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default Could a Mac user please test this Python code...

It's in the ReaChorder thread, which has been around for a while so you might not have seen the possible fixes for Tkinter GUI windows in Python ReaScript on Mac that Veto has put together on page 2...

https://forum.cockos.com/showthread.php?t=200185&page=2

It would be good to have a answer to this question.

Code:
import sys 
import os 
import tkinter 

sys.argv=["Main"] 

root=tkinter.Tk() 

### 1 
root.lift() 

### 2 
#os.system('''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' ''') 

### 3 
#os.system('''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "python" to true' ''') 

### 4 
#root.attributes('-topmost', 1) 
#root.update() 
#root.attributes('-topmost', 0) 

### 5 
#root.iconify() 
#root.deiconify() 

lbl=tkinter.Label(root, text="Hello World") 
lbl.pack() 
root.mainloop()

Last edited by snooks; 01-21-2018 at 03:53 AM.
snooks is offline   Reply With Quote
Old 01-13-2018, 04:01 AM   #2
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

Thank you for your contribution snooks.

IMHO, it would be very convenient to have a separate thread for OSX users who want to use Reachorder.
Cause the current Reachorder thread is becoming really large and it becomes cumbersome to lookup.

In the new OSX thread, it would be nice for starters, for rookies, to have a very detailed explanation of:

- which exact version of Python-OSX to install, and where exactly to get that version.
Sidenote: I am on OSX 10.13 and i can't even get a regular python installer (from python website) to install, cause it gives me an error that there is nothing to install
So had to look for other ways to install python (like via homebrew).

- Where to get the right installer(s) for installing Tkinter OSX and exactly what to do to have it installed correctly.

I think these above 2 are really important: to be sure you have correct version of python-osx correctly installed and also Tkinter.
When you know these installs are 100% correct, dan we can go from there to handle the issue(s) that occur when executing Reachorder.
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 01-13-2018, 02:32 PM   #3
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

Hi Veto, i respect your everlasting help to this thread, you have good Karma !

I just ran that "Hello World" python script again (i have done some Reaper beta updates in between, and it has been awhile) and here is the outcome:

- I execute the script in Reaper Main Window.
A popup Window appears, stating "API test Hello, world"

- I opened MIDI editor, then opened Action list (choosing section Main) and ran the script:
A popup Window appears, stating "API test Hello, world"

- Using Python OSX 3.3 (is seen by Reaper)
Sidenote: I am not sure anymore how exactly i installed this Python version.
I do know that the v3.3 installer from the official python website gave me an error when i started install "can't install because there is nothing to install"
I think i then installed 3.3 by means of homebew.

- Reaper Reaper 5.71pre12
- OSX 10.13.2
- I installed this version of Tkinter:
https://www.python.org/download/mac/...vetcl-8-5-18-0
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 01-14-2018, 02:02 AM   #4
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

Hi Veto,

I made the test script and ran it.

Outcome:

A popup window with this:

3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]

8.5
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 01-19-2018, 02:21 AM   #5
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

So near, yet so far. Does any other Mac user want to test this?
snooks is offline   Reply With Quote
Old 05-30-2018, 01:26 PM   #6
wearehappy
Human being with feelings
 
Join Date: Dec 2017
Posts: 38
Default

Quote:
Originally Posted by snooks View Post
So near, yet so far. Does any other Mac user want to test this?
Thanks a lot for putting up your ideas.
I tried all of the 5 approaches, none worked on macOS High Sierra, Python 3.6.4 x64 (Homebrew).

The only workaround I have is write tkinter code into another script, and subprocess it, but this is ugly and requires persistent data exchange or custom IPC.
wearehappy is offline   Reply With Quote
Old 05-31-2018, 12:24 AM   #7
cyrano
Human being with feelings
 
cyrano's Avatar
 
Join Date: Jun 2011
Location: Belgium
Posts: 5,246
Default

FWIW:

I have six python versions installed on Mavericks. One came with OSX, others are installed either from an "official" installer, or with HomeBrew.

On my test machine, the paths to these versions are not the same in Terminal, the gui and other applications. Partly because for some web apps, running in the Apache2 that's included in Mavericks, need different versions. I have no clue why Terminal, Finder and others are seeing different paths.

I've tried clearing this mess, but it always results in one or more web apps no longer functioning. Since I need those, I've stopped trying.

I'll be upgrading to a clean El Capital machine soon and this time, I've promised myself to keep it simple (just a few python versions) and keep notes to be able to track back to see which differences stem from what action.
__________________
In a time of deceit telling the truth is a revolutionary act.
George Orwell
cyrano is offline   Reply With Quote
Old 11-10-2018, 07:54 AM   #8
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

snooks, you are a genious, but your lua programs are not in ReaPack, so they are hidden from the masses kind of, like your Live MIDI Delete.
TonE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.