Keynote Delete Blank Slides

Hi,

I’m trying to automate my studying process, and part of that involves removing blank slides from a giant keynote presentation. I have no experience with AppleScript, but I’m trying to pick up stuff as I go along.

This is what I have so far:

tell application “Keynote”
set x to title of current slide of slideshow 1
if x is “” then
delete current slide
end if
end tell

What am I doing wrong? Also, how would you get it to go through every slide?