4 Topics

Member Avatar for
Member Avatar for krystosan

I have made a python script that takes path of a folder and dispalys images in gallery or slideshow made in pyqt? So how do I add a right click menu of the folder in finder to pass the same folder path as argument to python script ?

0
173
Member Avatar for FALL3N

[CODE] import os; def callAS(cmd): os.system(cmd); def selectFile(): callAS("""osascript -e 'tell application "Finder" to return choose file "Select the file:"'""") def fixPath(raw): arr = raw.split(' '); return(str(arr[1])); thePath = selectFile() thePath = fixPath(thePath); print(thePath); [/CODE] When the above code is run in IDLE, it just gives an error. But, when …

Member Avatar for FALL3N
0
287
Member Avatar for FALL3N

I want to run a multiline AppleScript command from a Python script. For a singleline command I can do: [CODE]def stupidtrick(): os.system(cmd) cmd = """osascript -e 'tell app "Finder" to sleep'""" stupidtrick(); [/CODE] however I want to run multiline commands, (such as with multiple 'tell' statements, as in [ICODE]tell application …

0
167
Member Avatar for bettersaid

[CODE]import os from appscript import * this = app(u'System Events').application_processes[param1].windows[param2].exists() while True: this1 = app(u'System Events').application_processes[param1].windows[param2].count(each=k.radio_button) if count == (this1): this2 = app(u'System Events').application_processes[param1].windows[param2].radio_buttons[param3].click() try: os.makedirs(param1) except OSError: if os.path.exists(param1): this3 = os.system('screencapture -C '+ param1 +'/'+ param2) while True: self.param2 = os.path.join(param1, 'win%s_%s_img_%s' % (param1, param2)) return param2 + …

Member Avatar for bettersaid
0
186

The End.