Hi,
I’m new to AppleScript, but I’ve managed to put together a script that automates some PowerPoint formatting tasks (we do a lot of PowerPoints here). It applies a master slide background, then applies our standard formatting to text and puts a border around pictures. I’ve been developing and testing it on a 65 slide presentation, and it works great for a while, but then it gets stuck. It tries to apply text formatting to a picture, which means the little test I have it doing isn’t working properly. If I remove the offending slide, it just gets stuck further down the road.
I’ve put the part of the script that seems to be the problem in here. It should take the shape, and if it’s a text frame, apply text formatting, and if it’s a picture, apply the border. The error message I get tells me it thinks a picture is text, and it can’t apply my formatting. It probably needs some clean up–I’ve just been trying to get the darn thing to work.
repeat with i from 1 to (count slides of active presentation)
if exists shape 3 of slide i of active presentation then
set sldThree to shape 3 of slide i of active presentation
if has text frame of sldThree is true then
set bold of font of text range of text frame of sldThree to false
set font name of font of text range of text frame of sldThree to "Arial"
set font size of font of text range of text frame of sldThree to 24
set font color of font of text range of text frame of sldThree to ({250, 250, 250} as RGB color)
end if
if has text frame of sldThree is false then
set myBorder to line format of sldThree
set dash style of myBorder to line dash style solid
set fore color of myBorder to ({250, 250, 250} as RGB color)
set transparency of myBorder to 0.65
set line weight of myBorder to 6
end if
end if
end repeat
Any suggestions would be much appreciated. (Sorry this is so long!)
Thank you!