Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Open twice a file if via pop up window of long press in apps dock
-
@omz In the misc part of V3.2news, you wrote "Opening a file that is already open in a different tab switches to that tab instead of opening the file twice".
But if I tap a file name in the popup window displayed when I long press Pythonista icon in the IOS 11 apps dock, this file is open in a new tab, even if it is already open. -
@cvp you sure? Just tried it and can't reproduce. Works as expected when the Pythonista is in the foreground, works as expected when the Pythonista is in the background. You sure you have 3.2?
-
@zrzka I'm in V3.2, but result is different if the file you tap is the selected or not tab.
Assume you have 4 tabs open in Pythonista. If the displayed tab is the file you tap, it's ok, but if the file you tap is not the displays one, a new tab is opened with this file... -
@cvp thanks. Trying to reproduce it, but no luck. Please, can you do one more thing?
- Create script,
ep.py
for example with following content:
import editor print(editor.get_path())
- Add this script to the wrench icon.
- Simulate your issue.
- Select tab with first occurrence of your file.
- Run
ep.py
from the wrench menu. - Select tab with second occurrence of your file.
- Run
ep.py
from the wrench menu.
When you compare these two paths, do they equal?
- Create script,
-
@cvp Does this also happen with files that have only ASCII chars in the path? Maybe the "à" is causing problems for some reason.
-
@dgelessus tried à here as well and no problem at all. I asked for the path, because I suspect there's a bug (or it's by design, dunno yet) in Pythonista or iOS. Check the file navigator, the a faire.txt is here two times - screenshot. How it did happen and why I say two times when you see just one occurrence:
- I did create a faire.txt in the blackmamba root folder,
- a faire.txt file appeared in dock long press recent files,
- tapping on it reveals Pythonista with this file, but this file magically appears in external files as well as a separate entry.
One is inside blackmamba folder (external folders), another one is directly in external folders (virtually two times, path & content equal). Anyway, no matter what I do, opening this file in any way leads to the same path. So, maybe there's something different on @cvp iPad. But the path should equal, we'll see when @cvp will check it.
-
@zrzka Paths are not equal
/private/var/mobile/Containers/Shared/AppGroup/D2BEB841-85E0-47B7-B01F-2E3A78C6CD21/File Provider Storage/77805465/0B-8WTUOPVyKeVWhPSzhkb3JxZWM/patience.txt /private/var/mobile/Containers/Shared/AppGroup/BC53E549-355D-4E77-BC46-64C3D3E0BDAF/Pythonista3/Documents/patience.txt
No ascii in this file name
-
Don't forget I do a long press on Pythonista icon in dock...
-
@cvp thanks. These are clearly two different files. You have two files with the same name, but in different locations. What happened IMO?
- Pythonista is launched
- You did open SCRIPT LIBRARY/This iPad/a faire.txt file
- You did long press gesture on dock, did select a faire.txt file and this file was opened from external location in a new tab, because name equals, but path differs.
The first path points to a file opened via Files.app (EXTERNAL FILES). The second path is a file in SCRIPT LIBRARY/This iPad.
This patience.txt file, new file you just did create? If so, please, can you be more specific how? Tap here, reveal this, wrote that, tap on that, ... Or you just renamed a faire.txt? If so, you did rename one occurrence and both of them were renamed? Do you remember if this a faire.txt was initially stored in another app? Did you copy a faire.txt to the Pythonista?
-
@zrzka no to all questions. patience.txt is an old file in my Pythonista, just used this one to be sure the accent on "à faire" was not the origin of the problem.
And you can see, that even old txt files, no more open in a Pythonista tab, stay in the recent files which Files App présent when I do a long press in the dock.
I'm sure the problem comes from Files App not from Pythonista -
@cvp thanks. Not sure, but I feel that you think that the long press shows files currently opened in tabs. I assume this based on:
And you can see, that even old txt files, no more open in a Pythonista tab, stay in the recent files which Files App présent when I do a long press in the dock.
Long press on dock icon behaves like history in Safari. It shows files you did open and then even closed ones. That was the reason for so many questions I had, because you can open file a.txt via Files.app, then close it, file is in the history, you can open a.txt from This iPad for example (not Files.app), but the file a.txt from Files.app is still in the dock icon long press history. When you tap on it, another tab is opened, because it's different file, it's the file you did open via Files.app, even a long time ago.
-
@zrzka Could you try the same sequence
- launch Pythonista
- open a .txt file
- close Pythonista, no remove from memory
- assuming Pythonista is in your dock, long press on it
- do you see the txt file in the presented ones?
- if yes, tap on it
- is it opened in a 2nd tab?
-
@zrzka sorry, previous post typed before I read your answer, which seems coherent.
Thus not a real problem but not very professional from Apple... -
@cvp tried, no problem. There's one thing which I find confusing. Recent files (long press gesture) contains files opened from iCloud & from Files.app (external files). But if you open a file from This iPad the file is not listed there. It can lead to a confusion, because when you open file with same name from This iPad, you do assume that the file appears there too and that it's your last file. But it's not truth.
-
@zrzka Agree. I remember I had created a directory in Pythonista/iCloud for testing but I don't remember if I placed these files there but I'm sure I just opened patience.txt file only yesterday for testing this problem and that this file has never been in iCloud...
But I agree to stop spending time for this.
Thanks a lot for your time and your explanations -
@zrzka I just see now that patience.txt file appears (just from now) in "external files" in Pythonista file browser...
If I delete them, they are not in Pythonista trash but stay in Pythonista Files App.. -
@cvp that's correct behaviour. What you see in external files is kind of link to folders / files from another applications. When you delete it in Pythonista (items in external files), you're just removing links - basically saying - okay Pythonista, forget about this file. The file is not actually deleted. If you'd like to delete, you have to open another application which provides this file and delete it there. Also it shouldn't change recent file items listing, because the file was not deleted. Example:
- I have a file in Dropbox
- I open this file in Pythonista via external files - Open...
- File appears in external files and in the recent files
- When I swipe to delete in Pythonista, the file is only unlinked from Pythonista, but it still stays in the Dropbox application
- If I'd like to delete it for real, I have to open Dropbox application and delete the file here
That's the reason why the button has label REMOVE and not TRASH. This applies to the top level items in the external files section only.
Another example:
- I have a folder in Working Copy
- I open this folder in Pythonista via external files - Open...
- This folder is
blackmamba
for example - Now I tap on the
blackmamba
folder in external files , swipe to left on any file inside this folder and destructive button appears - This destructive button has title Trash, because it's not the top level item in external files and when you tap on it, file is actually deleted, even in the Working Copy
Behavior depends on the level in external files (nested or top level) and one should read button titles:
- Remove - Kind of unlink from Pythonista
- Trash - Real trash
-
@zrzka Thanks for this (very clear) explanation.
But, sincerely, I really don't understand in which other app resides my .txt files I see in this pop up... -
@cvp me neither. It can be a bug in iOS, in Pythonista or just some experimentation throw back. The only think I know (based on paths) is that one file is in This iPad and another one comes from any other application (not an iCloud file, path would be different).
-
@zrzka I've found from where these files come...
In Files App, you have (bottom left) a bouton "recents" and you get a list of recents files with their app.
These Pythonista files are recents for my Google Drive app because I've a kind of synchronisation between Pythonista and Google Drive.
I've written a script which scans my Pythonista files and, if modified since their last backup, sends them to my Google Drive account.