Unable to select a picture shape in Powerpoint

I am unable to select the picture/placeholder shape in a slide, to apply threeD format options and other effects to those.

         set slideNum to get slide 25 of activePresentation
	 repeat with theShape in (get shapes of slideNum) --Tried with (get pictures of slideNum) as well
		-- Check if the shape is a picture
		if type of object of theShape is picture then
			-- Set the rotation of the picture
			set rotation X of threeD format of theShape to 350
			set rotation Y of threeD format of theShape to 30
			set rotation Z of threeD format of theShape to 200
		end if
	end repeat

Try this:

tell application id "PPT3"
	set theShapes to shapes of slide 1 of active presentation
	repeat with theShape in theShapes
		-- Check if the shape is a picture
		if shape type of theShape is shape type picture then
			-- Set the rotation of the picture
			set rotation X of threeD format of theShape to 350
			set rotation Y of threeD format of theShape to 30
			set rotation Z of threeD format of theShape to 200
		end if
	end repeat
end tell

Or this if you want to work with selected pictures:

tell application id "PPT3"
	set theRange to shape range of selection of active window
	repeat with iShape from 1 to count shape of theRange
		set theShape to shape iShape of theRange
		if shape type of theShape is shape type picture then
			-- Set the rotation of the picture
			set rotation X of threeD format of theShape to 350
			set rotation Y of threeD format of theShape to 30
			set rotation Z of threeD format of theShape to 200
		end if
	end repeat
end tell
1 Like

The first one worked, thanks mate.