How to select all the image files in the XD document?

Can anyone help me out in how to select all the image files with “.jpg” , “.png” formats in the XD document???

Hi @rajashekarb, the images represented on the artboards are renditions of the image files, not the image files themselves. While you can certainly select these renditions, that does not mean you will have access to the original files like .jpg, .png, and others, unless your plugin loaded the images. Hope this helps!

Can I select those renditions of image files and manipulate them using my javascript without ever leaving adobe xd.
If so can you tell me the process?

  • Thanks!

What’s your use case here? Just curious what you’re trying to achieve so we can better help.

I’m working on an image compression plugin. The use case/requirement is to reduce XD file sizes. The plugin should auto-select .jpg and .png files across artboards and apply compression to them.

So far, I’m only able to apply compression by selecting the images individually. Is there a way to auto-select the images by their extension when the plugin is invoked and apply compression to them?

@rajashekarb due to the current edit context limitation, global find and edit/replace is not possible at the moment. More info: https://adobexdplatform.com/plugin-docs/reference/core/edit-context.html?h=edit%20context

Okay, Thank you!
Btw can you tell me how to invoke the plugin commands twice even though it is clicked once.

What would be the use case? You can simply run the function twice inside your code if I understood what you meant correctly

Thank you for the reply!
But, I’ve figured that out :grinning: