ios 11 support of "files app"

yz
yzrzi
Posts: 8
Joined: Wed Jul 20, 2016 8:52 pm
Platform: Mac + iOS

Sat Jul 15, 2017 2:28 am Post

Dear Scrivener Team,

I have been testing ios 11 using the public beta and the new files app is a refreshing addition to ios: I can now have all my files in a single place.

This helps with another problem for those of us that consider privacy to be of paramount importance. This means being able to bypass iCloud and Dropbox altogether while also being able to sync files between devices. A combination of an app such as the "Files app" and of a tool such as "InterConneX" now make this a real possibility and rather straightforward.

Will you consider enabling Scrivener to allow use of the "space" of the "Files App" instead of its own? Currently, a Pages document that is inside Files.app will open directly in Pages when double-clicked without requiring the user to make a copy to the Pages' space. Being able to do the same with Scrivener will be awesome as it will allow syncing of a Mac and an ipad version of a scrivener project by syncing their respective directory structures.

Also, when I create a new Scrivener project the available ipad "Locations" should now include the Files app to allow the project to reside there.

Thank you for considering it!

User avatar
KB
Site Admin
Posts: 19190
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Jul 15, 2017 12:33 pm Post

Hi,

I am looking into support for Files app. It looks fairly straightforward to have Scrivener's files appear in Files app, but there are other technical difficulties to be solved, such as getting Scrivener files to appear as files and not folders (since they are file packages, and I've read that there are currently some difficulties in Files app with packages) and allowing them to be opened from Files app or stored anywhere (given how the storage system works in Scrivener and the challenges of modifying that). Hopefully nothing show-stopping, but I've only just started to investigate how we can approach it, so I'll know more when I've experimented properly.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

yz
yzrzi
Posts: 8
Joined: Wed Jul 20, 2016 8:52 pm
Platform: Mac + iOS

Thu Jul 27, 2017 12:36 am Post

Thank you for looking into this Keith -- it is much appreciated!

For what is worth .scriv packages appear already as "files" in Files app. I managed to transfer a .scriv bundle to Files.app. When I doubleclicked I was prompted to "import" into scrivener - I did and everything was there and worked just fine (but the project had to be moved to Scrivener's space).

It might be worth considering the opposite: instead of making Files aware of the package, you could make Scrivener aware of Files and allow it to look for files in other "Locations" and to open them without taking them out of the container where they are found. Also when 'Exporting' maybe you could allow an option when one can export the package as a package and not as a zip file. BTW, under ios 11 beta when you tell MS Word to look for a .docx file in other Locations it will open it and allow editing without moving it to its own "space." (Isn't .docx a package just like a scrivener project ?)

Again thank you for all you have been doing for Scrivener and for us Scrivener fans for many years!

User avatar
devinganger
Posts: 903
Joined: Sat Nov 06, 2010 1:55 pm
Platform: Mac + Windows
Location: Monroe, WA USA
Contact:

Thu Jul 27, 2017 7:43 am Post

Docx is a package in the sense that if you rename docx to ZIP and run it through an unarchive program, you will have a collection of files.
--
Devin L. Ganger
Devin on Earth: http://www.devinonearth.com/
Plotter on the streets, pantser in the sheets

User avatar
KB
Site Admin
Posts: 19190
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu Jul 27, 2017 8:57 am Post

In macOS technical terminology, as .docx file is not a "file package" but a single file because it is zipped up (although it is indeed a package in wider terminology). "File packages" on macOS specifically refer to files that *look* like files in the Finder, but are really folders. If you move a .scriv file to a computer that doesn't have Scrivener installed, or to a Windows machine, it will look like a regular folder. It's just a special feature of macOS that apps can tell it to treat folders with certain extensions as though they are files.

In my own testing of iOS 11, I saw that Scrivener projects looked like folders in Files, but acted like files. That is, they had folder icons but tapping on them didn't drill down but offered to import them into Scrivener. This is because of a minor issue in the way Scrivener registers the files as both folders *and* packages. I've fixed that for the next update.

I'm also working on have Scrivener support "open in place", which is what is necessary here (so that Scrivener can open files from their original location rather than importing them), and I will add a picker that allows you to add .scriv files from outside of Scrivener's space and work on them directly in Scrivener.

It's not possible to have anything inside Scrivener that will allow users to choose to save Scrivener files in another location, though. The iOS browsers that allow you to pick files from outside an app's space only allow for opening or importing files, they do not allow for saving files in other locations (although I'm sure that will come at some point in future versions of iOS).

Adding support for opening projects in place is non-trivial, however, because Scrivener needs to be much more careful about how it saves files, in order to avoid creating conflicts. I currently have a tech support issue out with Apple on a couple of problems I've run into with this (including what seems to be a major bug in iOS 11), and am waiting for them to get back to me before being able to continue. I'm hopeful that I'll have all this working for a future update, though.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

yz
yzrzi
Posts: 8
Joined: Wed Jul 20, 2016 8:52 pm
Platform: Mac + iOS

Thu Jul 27, 2017 10:17 pm Post

Keith,

The news that a future ios Scrivener release will be able to open files "in place" or to open files from other locations without importing is terrific. I can't wait (;-) and will be happy to beta-test it if it helps.

Thanks again!

Ch
ChrisRosser
Posts: 236
Joined: Tue Jun 26, 2007 12:11 pm
Platform: Mac + iOS
Location: Melbourne, AU
Contact:

Thu Jul 27, 2017 11:25 pm Post

KB wrote:In macOS technical terminology, as .docx file is not a "file package" but a single file because it is zipped up (although it is indeed a package in wider terminology). "File packages" on macOS specifically refer to files that *look* like files in the Finder, but are really folders. If you move a .scriv file to a computer that doesn't have Scrivener installed, or to a Windows machine, it will look like a regular folder. It's just a special feature of macOS that apps can tell it to treat folders with certain extensions as though they are files.

~~Snip~~

All the best,
Keith


Keith, I imagine you've thought about changing Scrivener's format to be binary (please don't :D ) or a zipped archive like docx/odt. I understand and appreciate why you'd discounted binary, but am interested in the technical reasons for choosing the Mac bundle format over a zipped archive. Doesn't Storyist use a zipped file based on ODT?

Apple's support for bundles is a head scratcher. From memory iWork files used to be bundles but Apple changed it when they the iOS versions. Considering that iMovie and Garageband are bundles (and work well with iCloud), I wonder if Apple have some private APIs for iCloud for managing bundles that they haven't released yet.
Mild-mannered Technical Writer by day, closet fantasist by night
I run Scrivener on macOS and iOS :mrgreen:
NanoWriMo| Twitter | Website | Facebook

sp
spudworks
Posts: 3
Joined: Wed Aug 09, 2017 8:07 am
Platform: Mac + iOS

Wed Aug 16, 2017 1:43 am Post

I know it’s been a while since this thread has been posted to but, as far as Files.app integration is concerned, I’d just like it if it was a place where I could keep compiled versions. I don’t need access to the raw scriv files. I just want to compile them, keep them locally and available to share when I want to email one.

Currently, my workflow on iOS is to compile, share to my Google Drive (though Pages for some reason also works on iOS11 as a dumping ground), and then attach the file to an email before sending. Obviously, if I can send an email, I have internet so not a super big deal but if I’m on reduced internet (like tethered to my phone), it’s bandwidth to share it up, bandwidth to bring it back down, and then bandwidth to send it.

Clearly, this is all iOS’ fault and the way they’ve made apps have to communicate with one another up until now. But if Scriv used Files to keep local compilations, it would cut out the middle man when just trying to send a copy to someone. Would be a great feature to have!

User avatar
KB
Site Admin
Posts: 19190
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Sep 16, 2017 11:57 am Post

A month-late reply here - sorry, I was on holiday for the last two weeks of August, so missed some of this.

Anyway, I have submitted an iOS 11-compatible update of Scrivener to the App Store, and it does support compiling files and saving them to Files app. You just choose the "share" button in Compile and choose Files app from the options, then you can choose where to save it - on iCloud Drive or in any of the containers exposed by apps.

I've exposed Scrivener's own container to Files app and made it so that you can open projects directory from there. If you tap on a project stored outside of Scrivener's container, Scrivener offers to import it.*

You can also import files using Files app, by selecting a file you want to import, choosing "Share" and then choosing to copy the file to Scrivener (a project has to be open in Scrivener for this to work). Annoyingly, though, although Files app supports choosing multiple files before tapping "Share", iOS currently does not have any way for an app to receive all of those files, so this only works with one file at a time. (I've submitted an enhancement request to Apple on this - there's an -application:openURL: method that apps have to implement to receive files, and I've asked them to change this to -application:openURLs: in future so that it can receive multiple files.)

* At the moment, when you tap on a Scrivener project stored outside Scrivener's own container (on iCloud Drive, say), Scrivener will offer to import the file. It will then copy the project into its own container. After the 3.0 busy period is over, though, I plan to make it so that you will be able to open Scrivener files directly from anywhere in Files app (rather than have to import them if they aren't in Scrivener's container). This will open up a lot more possibilities. It requires some work, though, because there are a number of factors that have to be taken into consideration when working with a file outside your designated container. I've been going back and forth with Apple's developer technical support and it took about three months of emails to thrash out what should be a decent solution (which I now need to implement), so unfortunately it wasn't possible to get this in for the iOS 11 release. If I can get it working, it will be a big deal, though.

Chris: the reason I don't use zip files is the same reason I don't use a binary file. There are no frameworks on macOS or iOS (I don't know about Windows) that allow you to read individual files from inside a zip file. So to work with zip files, I'd have to have Scrivener unzip the entire project package to a temporary location somewhere and zip it up every time you saved. As you can imagine, this would take a *long* time for large projects. Apps that use zip files, such as Pages and Storyist, are not designed for big projects containing lots of research as Scrivener is, so they can read the entire file into memory in one go and aren't working with the files individually. That's why such apps can work with iCloud easily where it's a lot more complicated for Scrivener.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

Ch
ChrisRosser
Posts: 236
Joined: Tue Jun 26, 2007 12:11 pm
Platform: Mac + iOS
Location: Melbourne, AU
Contact:

Tue Sep 19, 2017 4:50 am Post

KB wrote:
Chris: the reason I don't use zip files is the same reason I don't use a binary file. There are no frameworks on macOS or iOS (I don't know about Windows) that allow you to read individual files from inside a zip file. So to work with zip files, I'd have to have Scrivener unzip the entire project package to a temporary location somewhere and zip it up every time you saved. As you can imagine, this would take a *long* time for large projects. Apps that use zip files, such as Pages and Storyist, are not designed for big projects containing lots of research as Scrivener is, so they can read the entire file into memory in one go and aren't working with the files individually. That's why such apps can work with iCloud easily where it's a lot more complicated for Scrivener.

All the best,
Keith


Perfect, thanks Keith, that both answered my question and scratched a technical itch. Good luck with the open from Files app feature; that will be a game changer!
Mild-mannered Technical Writer by day, closet fantasist by night
I run Scrivener on macOS and iOS :mrgreen:
NanoWriMo| Twitter | Website | Facebook

User avatar
devinganger
Posts: 903
Joined: Sat Nov 06, 2010 1:55 pm
Platform: Mac + Windows
Location: Monroe, WA USA
Contact:

Tue Sep 19, 2017 6:17 am Post

KB wrote:There are no frameworks on macOS or iOS (I don't know about Windows) that allow you to read individual files from inside a zip file.


Last I knew, there were some cross-platform solutions that were meant more for archivers, etc., but they were in languages like Java and .NET. In fact, in 2006 I got to write a demo for Microsoft that showed how easy it was to use native Java to open up and modify Word files in the forthcoming 2007 .DOCX format as compared to the old .DOC standard -- I wasn't allowed to use any of the existing archiver SDKs.
--
Devin L. Ganger
Devin on Earth: http://www.devinonearth.com/
Plotter on the streets, pantser in the sheets

It
It's Me
Posts: 15
Joined: Sun Apr 27, 2014 12:36 am
Platform: Mac + iOS

Wed Sep 20, 2017 7:35 am Post

Hello!
How do I upload my files to the iCloud file app? :oops: this is on...
728A5EC9-A648-4F2C-A12C-174AD94C3C02.jpeg
728A5EC9-A648-4F2C-A12C-174AD94C3C02.jpeg (133.78 KiB) Viewed 1035 times

But nothing seems to be happening.
Thanks!

User avatar
KB
Site Admin
Posts: 19190
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed Sep 20, 2017 2:49 pm Post

Hi,

There's no way of doing that at the moment, I'm afraid. That option automatically appears in an app's Settings when it even allows importing files from iCloud Drive, which Scrivener does. For now syncing is all done through Dropbox, as per the app description on the App Store.

However, I am *hopeful* that we'll have some iCloud Drive support coming to a future update. (iCloud support is much more complex in Scrivener because of the way its file format allows for any amount of research, and iCloud has not really been designed with this particular kind of falling-between-stools file format in mind.)

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
lunk
Posts: 1741
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Wed Sep 20, 2017 3:56 pm Post

Regarding iCloud Drive on OS X and iOS: I use a photo scanning app called Unfade which syncs to iCloud Drive. The content is visible on all my iOS devices using the iCloud Drive app, but not on any of my Macs using Finder, nor on the web interface for iCloud Drive. So iCloud Drive definitely has some odd quirks.

It
It's Me
Posts: 15
Joined: Sun Apr 27, 2014 12:36 am
Platform: Mac + iOS

Thu Sep 21, 2017 12:47 am Post

Thanks for replying. I saw it while having a peek at all the new bits and bobs.