1

When using the org-attach function on macOS the IDs are that are created are uppercase. It is possible to change the folder name to lowercase via (advice-add #'org-attach-id-uuid-folder-format :filter-return #'downcase) but the format in the ID property remains uppercase.

Example:

org attachment relative location (after adding the above advice): data/3e/8bb725-3fb7-4f3f-80b2-baa4369a48ce/example.pdf

snippet from org file:

** Example                                                             :ATTACH:
   :PROPERTIES:
   :ID:       3E8BB725-3FB7-4F3F-80B2-BAA4369A48CE
   :End:

On macOS I can still open the attachment because of filesystem case-insensitivity. However on Linux if you try to open the attachment, no corresponding ID can be found. I would like all org-attach IDs to be lowercase in both the folder name and its reference. How can I accomplish this?

Edit: uuidgen is used on macOS and Linux for me, and org-id-new/ org-id-get-create/uuidgen always returns an uppercase ID on macOS and lowercase ID on Linux.

1
  • In my (Fedora 33 linux) system, ID's are lower case. You need to figure out what method you are using to generate IDs and go from there. Start by evaluating (org-id-new) in your *scratch* buffer and seeing what it gives you. It's likely that the uuidgen executable is used: try it from the command line and see what it gives you. Edit your question and add that information to it.
    – NickD
    Commented Nov 5, 2021 at 15:33

2 Answers 2

2

Are you wedded to using uuidgen? Org-mode has its own internal functions to generate uuid's, which will be used if you customize org-id-method to org. See C-h v org-id-method RET.

1

Alternatively, on MacOS write a uuidgenlc script that downcases the output of the "real" uuidgen and set

(setq org-id-uuid-program "/path/to/uuidgenlc")

uuidgenlc could be as simple as

#! /bin/bash

uuidgen | tr A-Z a-z

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.