Is there a way to attach a file into a notebook and open it later with, for instance, a double click (or another action button)?
In Mathematica windows version, the insert menu has the "object..." entry and I can indeed embed an object into my notebook. But then, I don't know how to exploit it in an attachment kind of way. For instance, in MS Word, if we "insert an object", we can then open it by double clicking its icon: windows opens the file with its predefined application.
For the purpose of the discussion, let’s suppose I want to attach a pdf file.
If this functionality isn't native on Mathematica, probably a technique based on this post can be used, with an intermediate step of export to a temporary folder, and then a Run kind of command...
I can also imagine a Dynamic interface, with a list of attached files (whose internal data/content is “kept” by a DynamicModule internal variable), and four buttons: add, delete, export and open. Since a Dynamic cell can be easily copied from a notebook to another, I could easily use this small embedding app on different notebooks.
There’s probably another button that would be useful: import. This would make the file content available, as a string, on a global context variable, or at least export the file to a temporary folder, and make its path available on a global context variable.
(if you go the "dynamic app" way, please consider, from the beginning, app conflicts if two apps are added to the same notebook; and a more tricky, or probably impossible task, to make some of its functionality work on the Player)
EDIT:
One answer that was deleted suggested SystemOpen for the "open" option, which seems a very good way of doing this part of the functionality
EDIT 2:
I was writing the following code when Sjoerd C. de Vries answered. My code is still only semi working but it gives an idea for a different interface approach.
DynamicModule[{id = 0, deleteFiles, selectEntry, addFile,
fPathTemp = Null, data = {},
legend = Style[#, Bold] & /@ {"", "id", "Icon", "Name", "Type",
"Date Added", "Date Modified", "kB"}},
Column[{
Dynamic@Grid[Prepend[data[[All, Range[8]]], legend], Frame -> All],
Row[{
FileNameSetter[Dynamic[fPathTemp, (fPathTemp = #; addFile) &],
"OpenList", Appearance -> "+"],
Dynamic@Button["-", deleteFiles, Enabled -> data != {}]
}]
}],
Initialization :> (
addFile := If[ListQ[fPathTemp],
AppendTo[
data, {False, id = id + 1, "", FileBaseName[#],
FileExtension[#], DateString[], DateString[FileDate[#]],
FileByteCount[#]/1000.,
ExportString[Import[#, "String"], "Base64"]}] & /@ fPathTemp;
fPathTemp = Null
];
deleteFiles := (data = DeleteCases[data, _List?#[[1]] == True &])
)
]

The "+" already works, but for the minus to work, it is missing a transformation of the False/True into a toggle interface (and then, obviously it is missing all other options...)
