You are not logged in.
Is it possible to write a script that removes all images from a numbers document?
I am working with a document that contains some company logos - it would be great if there was a way to delete anything that ends in .png or .jpg?
Remove images whose name ends with ".jpg", ".jpeg", ".png"
CAUTION: it doesn't remove images inserted in cells.
I don't know how to get pictures pasted in cells.
Yvan KOENIG (VALLAURIS, France)
tell application "Numbers" to tell document 1
repeat with s from 1 to count sheets
tell sheet s
repeat with i from (count every image) to 1 by -1
set itsName to file name of image i
if (itsName ends with ".jpg") or (itsName ends with ".jepg") or (itsName ends with ".png") then delete image i
end tell # sheet s
Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) mardi 18 avril 2017 17:39:27
Last edited by Yvan Koenig (2017-04-18 12:13:10 pm)
Thanks for the reply Yvan,
Unfortunately that script isn't working. I'm getting a "cant get image 1 of table 1 of sheet 1 of document 1" error
Would behave better if you remove the instruction
tell table 1
which is not in my script
Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) mardi 18 avril 2017 19:14:25
HAH! Oh yes.
Works perfectly, now I've followed the instructions properly!