Start a new topic

Hyperlink to Apple Photos?

Would it be possible for BeOrg to implement (say) an "apple:" hyperlink that can get photos directly from Apple Photos?  I'd really like to make tasks that not only can describe the work that needs doing, but also provide a picture (or two) to illustrate the work.  We could later setup a different definition for "apple:" under Org to link to a local directory of photos.  I think we talked about using attachments for this at one time.  The hard part is making the photos accessible on the iPhone.


Do you have ideas?


I don't think iOS supports linking to photos in the way. There are some internal URLs to library assets, but I think they are time limited and secured to particular use cases. Support for attachments is still in the backlog, and hoping I get time to work on that at some point.


1 person likes this

Hmm.  That will be a problem as it now means the photos have to be copied out of Apple Photos to be used by Beorg.  That obviously causes problems with syncing and such.  I was hoping that we could create an Apple specific way of accessing Apple Photos.  How do other applications (like picture editors) get access?  If we can create a special hyperlink, we can redefine the hyperlink under Emacs to do attachments.


Do you know [[PhotoKit]]?  The hard part will probably be figuring out a generic "URL" to pass to PhotoKit that it can use to find the appropriate photo as I don't think photos have a unique name we can use.  When I download Photos from my library, it creates a zip file containing the photos with names like "IMG_####.jpeg" -- perhaps that can be used. 

It should be possible for beorg itself to work with a PHCloudIdentifier, which should uniquely and persistently identify a photo stored in a user's iCloud photos library. It would probably (but I would need to research this more) a helper app to be written for macOS so that it could then be used from within Emacs. This is all useful discussion, which I'll keep under review.

That sounds good.  Note, though, in a first iteration, don't worry about Emacs.  Define it as a new hyperlink type and that could be added to Emacs later in a "free" form.  A simple first form for Emacs would be to just treat it as another name for "attachment".


When you say written for MacOS, what about iOS?

If I did this then the iOS beorg app would be able to retrieve and display the photo itself. On macOS in Emacs however it may require that there is an Emacs helper function and possibly some kind of binary required to show the photo.


1 person likes this

Better idea might be to have a helper function/binary that:

  1. Takes the information passed from the Emacs External Link.
  2. Requests the photo from iCloud with supporting info.
  3. Converts the photo to JPEG (HEIC isn't well supported yet).
  4. Saves the photo to an "attachment" directory with supporting info.
  5. Return the attachment file name to Emacs (it'll handle the JPEG)
  6. Refinement: compare supporting info from iCloud  to info last fetched to see if photo needs to be recopied or deleted
  7. You might need to require ImageMagik on the Mac.
Some things to hack, but photos would be a fantastic addition to BeOrg.

Login or Signup to post a comment