@mmynsted thank you very much for the in-depth reply. the applescript is probably not difficult.
the problem is that i do not like the DT “editor” and would love to use another one (ulysses for example). But with the way DT stores the data, I don’t know how to embed an image in markdown and still make it visible in another editor.
This is all macosx anyways. Considering I am also a heavy ios user, i don’t see a way of making the solution cross-platform at the moment.
For example, let’s i have the image applescript as you describe, what do i do when i have an image on ios? on ios it is even more vital to not use the horrendous DTTG “editor”.
One other thing. To start the macro, you need to have the file selected in Finder. Leave the mouse at the position where you selected the file (so that it can drag the file into Devonthink).
Has anyone done something like that? That to me would be a super useful script to share. Im also exploring various ways to quickly deal with local images in md files that would be portable
thx @BLUEFROG, a bit off topic for this thread but your support is the best I’ve seen for any app I’ve ever used (FLOSS or commercial) in 25 years of using software…its really appreciated immensely and helped me stay afloat when starting to use devonthink…
…back to the point!
so yes the issue for me is downloading the image associated with the buffer link for future reference and also compatibility with other apps/portability. Ive have many experiences with my org-mode text files linking to images in websites that then went dead and thus I like to save all images localy.
after reading through the forums a lot on this topic this thread seems to be describing mostly what I had in mind but I agree with @bosie that the current situation is kinda cumbersome. for example I’ve used emacs org-mode for nearly 15 years and there is a little package there called org-download:
This extension facilitates moving images from point A to point B .
Point A ( the source ) can be:
An image inside your browser that you can drag to Emacs.
An image on your file system that you can drag to Emacs.
Point B ( the target ) is an Emacs org-mode buffer where the inline link will be inserted. Several customization options will determine where exactly on the file system the file will be stored.
They are: org-download-method :
'attach => use org-mode attachment machinery
'directory => construct the directory in two stages:
Back to devonthink, basically the workflow that I personally am looking for is
launch a new markdown file and start editing
when I need to add image (be it locally or from the web) I can just either:
drag an image from a browser
copy the image URL
drag /copy image from finder
the a screen shot via system screenshot util
opaste image from clipboard
then this process/script will
insert a proper markdown link with full path to the image
create a group with the name of the current markdown file, create a sub directory inside that group called img or any other name
copy the md file into the group
copy the image into the imd file
does that make any sense seems complicated just describing it. unfortunately I have zero programming knowledge…(I an academic in the humanities…:). So wouldn’t even know where to start with this
Also would love to hear any alternative workflows from the community that will allow easy work with images in a self contained way that works both in DT but also be portable
ofc the holy grail would be that the capture/sorter function in devonthink could do that for you
Why don’t you use the method I describe, using a group to contain the file and assets and using relative links, no different than web pages do?
Make a group.
Add a Markdown doc.
Drag and drop your image into the group - or a subgroup, if you want to use such a structure (I do).
Drag and drop the image into the Markdown source and the link is inserted.
In fact, now that @cgrunenberg added the drag and drop into Markdown like this, I use this method even more… every single day. (And yes, I used to type the links out, and still find that to be an acceptable way to enter them. )
@BLUEFROG as said before, this seems like a terrible long-winded way of doing a one-step action. the drag and drop doesn’t work out of firefox, so now i have to do what?
save it to disk (why?)
then find it in Finder
navigate/open the subgroup in DT
drag the image into the subgroup from finder
Drag the image from the subgroup into the markdown (this isn’t straight forward either since the markdon document is at this point in View mode and not editable)
compare this to
drag from firefox into markdown doc
additionally, even when you are doing your way, it isn’t viewable by other apps, is it? those relative paths don’t work in other apps
I actually like the method @BLUEFROG suggested (but I use safari).
I tried it now and it makes a lot of sense. I even exported the whole groups via the export files and folders and opened it in Bbedit and the images rendered well!
save it to disk (why?)
I actually do want to save it in disk so I have it permanently there even if the website dies.
the only issue is how to automate it in terms of maybe a quick way to convert an existing .md file to a group and putting that file in it, while also creating a imd folder in that group. That would make things a bit easier when you repeat that.
perhaps an apple script could fit? Or maybe I can play with keyboard maestro but @BLUEFROG suggested in multiple occasions its better to script rather then use GUI macros ;d
@bosie, yes I want to save it to the devonthink but also I just saw another workflow:
this one docent save in devonthink yet rather saves all image files for all .md files regardless of where they are in a central dropbox repo (images) and refer all image links to that folder\
now another dilemma comes up. Use that method of a central repo or the nice self contained within devonthink method @BLUEFROG suggested……
any thoughts guys of the cons and pros of each method?
would love to hear for the users here to finalize on a method so I can start actually collecting notes
I still don’t get why you want your images in dropbox but your markdown in devonthink.
it sounds like you shouldn’t be using devonthink at all for markdowns. just save everything in dropbox and use a proper markdown app for editing/viewing the files. you can then use DT to index the external folder. That way you can have DT suggest other files with ‘see also’ etc but you also get proper markdown support.
even when you are doing your way, it isn’t viewable by other apps, is it? those relative paths don’t work in other apps
That is incorrect and easily proven.
My method is no different than creating a standard web page (which is ultimately what Markdown is rendered as).
If you use the Item Link (x-devonthink-item://), then you are correct. Those are not going to act as valid image links outside DEVONthink. But they’re also not static URLs either, so don’t use them if you’re going to work with the files outside DEVONthink. Simple.
the drag and drop doesn’t work out of firefox, so now i have to do what?