Compile Draft including embedded media files as attachments

Last week I got an e-mail from an editor. “I like your text,” he wrote and my heart started to jump: This would mean up to 20 Euros for me! Hooray! “But”—he continued—“could you please send in the image that was embedded in your .doc, our graphics department can’t drag it out from there.”

A moment later I received another mail from him: “Oh well, never mind, I found the image file in your mail that contained the text.” Because I knew they would need the image as a separate file I had added it as such in the first place.

This gave me an idea—and it is yet not more than just an idea. I have not thought thoroughly about all the consequences it might have:

When you write a text with a lot of illustrations you probably will insert them into the text so the editor or whoever sees where they belong. But for further processing they will be needed as separate files.

It would be great if Scrivener could automatically attach files embedded in a text as separate files.

I do not want to soften the concept of the strict separation of the draft folder and the research folder. I was thinking of an additonal “attachments” folder.

Compile Draft would work as it does but would have the option “Generate a .zip file including the draft (as .doc, .rtf etc.) plus the files in the attachment folder”.

One question that arises is how the files would get into the attachements folder. Manually is one way but if done automatically you would not be forced to keep track of which image you have put into the attachements folder and which not.

Maybe another option “Automatically add embedded media files to attachment folder” would come handy?

I have no real technical knowledge about how all of this could work programming-wise. But I do know that .rtfd is a package format containing the pure, rich text as a .rtf and the optional embedded files. If Scrivener could somehow copy these media files in the .rtfds to the attachment folder …

‘But what happens if a media file gets removed from the text later?’ he asked himself.

And should the attachments folder be visible to the user at all? Since chunks of the text might get excluded in Compile Draft so must their embedded media files.

Possible solution: The contents of the attachment folder should be generated not before Compile Draft and only for it. Which would keep the size of the project significantly smaller as the media files are not duplicated in an attachment folder that is part of the project.

So if the option “Include attachments” is chosen in the first step the Draft would get compiled as usual, in a second all text chunks included in the draft would get scanned for media files which would be copied into an attachment folder. And then it all gets zipped. (Zipping could be just an option as all of the attached files together might be too big to be sent by a single e-mail, for example. If only the attachment folder was generated and not zipped the user could manually split its content into an appropriate number of zip files.)

And maybe automatic renaming and numbering of the attached files would be useful.

And the option to automatically add the file names of the embedded media files right underneath them in the draft so the editor can identify the files.

I better stop here.

Keith will have to comment on the viability of this as a feature, but Scrivener can already do what you want. Without requiring the use of MMD, you could simply choose to export as one of the MMD options (any of them will work, but raw MMD would be the safest). Scrivener will compile the document as per normal, but in addition it will collect all embedded resources [size=80][1][/size] as well as linked resources (using Scrivener links or MMD links, which you won’t have any so that is irrelevant) and place everything together in a folder. After doing this, you can just compile using your preferred document format and place it into this folder as well, deleting the MMD file.

[size=80][1] Oops, you cannot do the embedded part yet with 1.53. Scrivener Links will be your best bet for now.[/size]