Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Uh. I encountered this a couple of years ago and found a solution for macOS. I will search and post shortly (I hope).
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
OK. Found it. I remembered working with Andy (structure) on this prior to his tragic passing.
if sys.platform == "win32":
os.startfile( helpFile )
else:
subprocess.call( [ "open", helpFile ] )
The OS test you have is fine, so that can stay.
The next question becomes "Do you care about blocking?"
I.e. the "open" call will basically just tell macOS Finder to open the file with whatever it normally would.
If you need Poser Python to wait for that app (whichever one opens the file) to quit, then a "-W" parameter after the "open" should work.
It all gets quite a bit harder if you need to test for the file being closed, rather than the app quitting.
Hope this helps. :-D
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
Thanks for the effort. I will integrate this into my Python code and then hope that it works as I imagine.OK. Found it. I remembered working with Andy (structure) on this prior to his tragic passing.
if sys.platform == "win32":
os.startfile( helpFile )
else:
subprocess.call( [ "open", helpFile ] )The OS test you have is fine, so that can stay.
The next question becomes "Do you care about blocking?"
I.e. the "open" call will basically just tell macOS Finder to open the file with whatever it normally would.If you need Poser Python to wait for that app (whichever one opens the file) to quit, then a "-W" parameter after the "open" should work.
It all gets quite a bit harder if you need to test for the file being closed, rather than the app quitting.
Hope this helps. :-D
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I am currently writing a tool to change the textures of figures and props at once. I start the Windows Explorer at a certain place. Depending on the operating system, the Mac OS Finder should also be able to start at this point. But I don't know anything about the Mac OS, nor do I have access to a Mac computer.
Can someone help me?
With kind regards
The code for the Windows Explorer in shortened form
import subprocess
import platform
command = 'explorer /select,"{}"'.format(self.__File)
if platform.system() == 'Windows':
subprocess.Popen(command)