Make it easier to find .org files in file picker
Per report: https://reddit.com/r/orgmode/comments/hthpd3/_/fyis69p/?context=1
First see about filtering file picker to just show .org files.
On iOS, specifying my custom UTI for org-mode files when calling UIDocumentPickerViewController.init(documentTypes:in:) does work to show only org-mode files as selectable. However Google Drive appears to be buggy and will show everything as unselectable:
https://support.google.com/drive/thread/18725542?hl=en&msgid=18725542
https://support.google.com/drive/thread/38729289?hl=en&msgid=38729289
Since my main syncing method is Google Drive, this is a blocker for me 😞
On iOS I tried:
- Setting a custom icon for the org-mode doc UTI. It turns out the system knows that the files are plain text, so it always shows a preview of the content instead of an icon. I can't find a way to disable the preview and show an icon instead.
- Claiming that the org-mode doc UTI conforms to
public.datainstead ofpublic.plain-text. This seems to force the file picker to show the.orgfile extension. - Setting
-[UIDocumentPickerViewController shouldShowFileExtensions]to true. This didn't seem to have any effect.
If you could atleast see the .org extension that would be a massive improvement. Then you could just search for org.
Being able to select multiple files would then mean you only have to go through it once.
The next version (pending review; may be on TestFlight soon) will show the file extensions. But in my testing the file picker's search doesn't find file extensions :(
So in case it helps anybody else, this is how I worked around this.
I have my org files under VC with git and I just created a seperate branch with only .org files:
cd ~/Notes/Org # or wherever your org files are
# Make a new branch
git checkout -b orgro
# Delete everything else
find ./ -type f ! -name '*.org' -delete
find ./ -type d -exec rm -r {} \;
# On this branch, in this directory, only track .org files
echo '
# https://stackoverflow.com/a/987162/12843551
# Ignore everything
*
# But not these files...
!.gitignore
!*.org
# ...even if they are in subdirectories
!*/' > .gitignore
git add -A; git commit
The idea is is to checkout the orgro branch, wait for Dropbox to sync, access the files on the iPad so they'll be saved and then git checkout master.
This would also work very well with WorkingCopy file sync on iOS (presumably a similar tool exists on Android).
If I create new org files the idea is to:
cd ~/Notes/Org
git checkout orgro
git merge master
# Now Add the files to the ipad through Dropbox
git checkout master