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


#1

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


#2

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!


Getting the exact location of the image placed in XD
#3

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!

#4

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


#5

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?


#6

@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


#7

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


#8

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


#9

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