Using linked images in markdown files

The kind should be identical to the one shown in the Finder which uses only the file extension to determine the type.

Amazing idea of the shortcut. BUT — when you define UTI as public.png or public.jpeg, the shortcut seems does not change file format, but only extension. So, if your iphone made HEIC, it remains HEIC with another extension, and DT does not render it in markdown.

I already set my iphone to make photos in jpeg. Old photos stay in HEIC.

Dear developers of the shortcut, please

  • change format as defined by UTI
  • import metadata

Once again, idea of the shortcut is great! I adopted the idea, and made my own shortcuts for photos.

Very interesting that I never ran into this but I see you are correct.

However, you can add a Convert Image action in the Repeat loop. Then point the Create Item to the Converted Image.

@eboehnisch: I will update the Shortcut(s).

@BLUEFROG, you made me happy.

The shortcut now

  • converts my old HEIC images into JPEG (it’s possible to choose balance between image quality and file size in Convert module)
  • imports metadata! (checked on mac)

BUT — DEVONthink To Go does not index/show geolocation.

Please check for geolocation.

Thanks for your work!

@BLUEFROG, what purpose for is UTI field? If I leaved it empty, the shortcut imports files as defined in Convert Image action — I defined JPEG, and it is imported JPEG.

Maybe no need to fill it?

That’s a known bug that should be fixed in one of the next releases, AFAIK.

Often, UTI stands for “Uniform Type Indicator” (it can also mean “Urinary tract infection”, but probably not in this context).

So public.png means that the image is of type PNG. For a JPEG, you’d use public.jpeg. Though than you’d have to change the “convert to” action above to return a JPEG, I suppose.

1 Like

Hahaha! I also end up telling people that’s what they’ll likely find if they Google UTI. :wink:

Glad to be of service!

As @chrillek noted already, this is known and should be addressed in the future.


With the Create Item action, the UTI may be optional when used in this manner. However, it could still be used in cases where you may be passing base64 encoded data.

Thanks for your comprehensive answer, @chrillek

Thanks for your encouraging answer, @BLUEFROG

:slight_smile:

You’re welcome.

@BLUEFROG Thanks for the updated shortcuts.

When I delete the markdown note, I want to delete the associate linked images in it. How can I do this easily in one go instead of going to each linked images to delete them?

You’re welcome.

What you’re suggesting isn’t possible without automation of some kind. The files, while linked, aren’t connected to each other.

Actually, DuckDuckGo knows it, too. And all other websearch engines, too. We might get away from the quasi monopolist if instead of “googling” we use the neutral word “websearching”. For we should not do the work for them monopolists as long as they don’t do any work for us. And DuckDuckGo is also free, you know?

Where are the images stored?
My practice would be a Group, holding the note and images (or replicants)
I can then delete the group,“easily in one go”

Amen! :wink:

@BLUEFROG could you advise what kind of automation? SmartRule or AppleScript? I might want to explore this as learning automation, if this is not too difficult.

Yes, I did consider using Group. But that is too much of an effort to get a quick note with a/few image(s). I am also more a Tag than Group person. So, I want to keep Group to minimum.

So, for such markdown quick note with image(s) created from iOS shortcuts. I will only tag the markdown note. I don’t really care about the images, after all they have item link that markdown note will get it shown in markdown preview. So, if I don’t need the markdown note, I want to delete it, along with the images that it link to. And usually, I don’t keep these markdown quick note for too long, as well as the images linked.

For a more complex notes and images that I will keep, I might use the method that @BLUEFROG describe in the below post.

In fact, for a complex notes, I might not want to use Markdown. Maybe, I will use RTFD or Formatted Note or even Pages.

Good plan, I think.

1 Like

I doubt that a smart rule will be of any help here – there’s no “on delete” or “on moving to trash” trigger. So no way to fire the smart rule.
Having said that, your second best bet is a script to delete a record with all images referenced in it. That can be written in JavaScript or AppleScript, whatever you prefer (though hunting links in a document with AppleScript… well, it can be done, but it is not pleasant).

However, you should maybe reconsider your setup. As @DTLow has said here and @BLUEFROG numerous times elsewhere, putting the markdown file together with the images it references in the same group is preferable. That way, you simply drop the group in the trash and are done.

Also, if you have your images somewhere™ (i.e. not in a group with the document referencing them) you can not really be sure that they’re only referenced by one document. If your script removes all images referenced in the document it is deleting, it might well invalidate another document, referencing the same images.

I’m not sure if this is just a façon de parler or a misconception. There is usually no such thing as a markdown file with images. There are only links to images (or other things) in a markdown file. The only exception to this is if you store the images itself as a data URL in your MD files (which will blow them up considerably and probably make editing a challenge).