The forum

POM 4.4.1 app shortcut cannot launch (OS X v10.15.7)

Author Replies
nvadekar Monday 12 October 2020 at 6:57
nvadekarAnonymous

the app that was created launches argv_emulator.py, which cannot run on catalina 10.15.7 with the following error... when i google this error is is realated to required 32 bit python support.   does anyone have an easy solutions...  thanks.

 

Desktop/Iris.app/Contents/MacOS/argv_emulator.py
Traceback (most recent call last):
  File "/Users/nvadekar/Desktop/Iris.app/Contents/MacOS/argv_emulator.py", line 110, in <module>
    _argv_emulation()
  File "/Users/nvadekar/Desktop/Iris.app/Contents/MacOS/argv_emulator.py", line 103, in _argv_emulation
    _get_argvemulator().mainloop()
  File "/Users/nvadekar/Desktop/Iris.app/Contents/MacOS/argv_emulator.py", line 44, in mainloop
    stoptime = Evt.TickCount() + timeout
AttributeError: 'module' object has no attribute 'TickCount'

makj Saturday 11 March 2023 at 14:21
makjAnonymous

Evt.TickCount() can be replaced by time.clock(), but I found no immediate replacement for Evt.WaitNextEvent(), so i changed the python script argv_emulator.py as described further down commenting away self._dooneevent(mask, timeout).

However, the easiest way to fix the problem is to edit the file /Contents/Info.plist by installing Xcode from App Store and use it as a .plist editor. Of course the Info.plist XML file can simply be edited using TextEdit.

<key>CFBundleExecutable</key>           <string>argv_emulator.py</string> must be changed to <string>playonmac</string>
This will bypass the python script and start the app directly.

I also tried updating /Contents/MacOS/argv_emulator.py testing with Notepad++. I then got the python script to start the app but in neither of the two solutions the argument passing works, e.g. opening a file in the Finder context menu with "Open with" Notepad++ does launch Notepad++ but does not open the selected file.

import time
def mainloop(self, mask = highLevelEventMask, timeout = 1):
            if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn':
                del sys.argv[1]
            stoptime = time.clock() + timeout
            while not self.quitting and time.clock() < stoptime:
#               self._dooneevent(mask, timeout)
                continue
#            if not self.quitting:
#                print "argvemulator: timeout waiting for arguments"
            self.close()
 
Also the .app files must be moved to /System/Applications. They do not work residing on Desktop and will not work if moved to ~/Applications.