Applescript to set a single PowerPoint slide background to a picture

I’ve hit the wall on trying to be able to set the background of a single PowerPoint slide (not the master slide) to a picture. Here is the code I have so far. Any help would be greatly appreciated! :confused:

set new_file to choose file with prompt "Open picture file for background:"
set new_file to new_file as text

tell application "Microsoft PowerPoint"
	set thePres to active presentation
	set theSlide to make new slide at end of thePres with properties {layout:slide layout text slide}
	tell theSlide
		set follow master background to false
		set display master shapes to false
		
		--code to set background picture to go here
		
	end tell
end tell

Here is one solution to this problem :slight_smile: :

set imgFile to getPicFilePath("Select picture file for background:")

tell application "Microsoft PowerPoint"
	set thePres to active presentation
	set theSlide to make new slide at end of thePres with properties {layout:slide layout text slide}
	tell theSlide
		set follow master background to false
		set display master shapes to false
		user picture of the fill format of the background picture file imgFile
	end tell
end tell

to getPicFilePath(thePrompt)
	set theResult to choose file with prompt thePrompt of type {"public.jpeg", "public.jpg", "public.png", "public.tiff", "public.tif"}
	return theResult as text
end getPicFilePath