How to import an image directly into a PS document without prompting the user with a dialog

Hi All,

I want to create a panel that shows 3 images each of which is a button. (I know how to do that no worries)
Then when the user clicks on one of the images show in the panel, the image will automatically appear as as a layer or get added to a layer in the current document. I’ve tried the usual methods of access images file via file storage system and the await … etc approach but all of these invoke the dialog which is not what I want. The auto import without prompting the user to select the image themself is essential to the work flow.

Is this even possible?

Thanks in advance!

You can access any file in your plugin data folder without the dialog.

I tried that but it still invokes the dialog. Also from what I understand other programs can’t access the plugin folder. I have a python program running that creates images on a folder on my hard drive and this PS plugin shows those images as sp-cards in the panel. Then when the user click on the card the idea was that the image shown on the card (which exists outside the plugin folder) would be copied into one of the layers in the document.