File Browser question
@Matteo to delete the file at end of your script
Import os os.remove(folder_path+'.folder.py')
@Matteo I think that it is not "magically". When you run a script, Pythonista opens its folder, thus...
@cvp Hi , thank you for reply: 'magically' because in previous posts we read that omz solution works only in version 3.2, when I run it in v3.1 I obtain a blank folder, even if I'm sure I have some files inside it.
After my last post I can open any folder programmatically also in v3.1 (it is not elegant because the solution I found needs to create a new file inside the folder where I want to go with file browser and in order to not see it I must hide it with a dot at the beginning of filename).
Thank you also for deleting hint, unfortunately when I add:
import os os.remove(folder_path + '.folder.py')
of script 'A', the script doesn't work as expected, because it deletes the file '.folder.py' even before that the istruction
Have you some other ideas about deleting a file named 'B' after a webbrowser.open use that needs the file 'B'?
@Matteo The script of omz did open a folder, your script runs a script, that makes the magic difference.
Put a little sleep after webbrowser.open to let it time to perform its action before the remove
import time time.sleep(0.2)
@cvp It works! Thank you, sometimes sleeping is good, also for a code ;-)
@Matteo Surely when the work is done during your sleep 😂