on run argv if (count of argv) > 0 then set layoutIndex to item 1 of argv set layoutIndex to layoutIndex as integer else error "Layout is not provided" number 60003 end if tell application "Microsoft PowerPoint" -- Get current slide number set currentSlide to slide 1 of slide range of selection of active window set slideIndex to slide index of currentSlide -- Add new slide set newSlide to make new slide at after slide slideIndex of active presentation with properties {layout:layoutIndex} -- Go to the new slide set theView to view of active window go to slide theView number (slideIndex + 1) end tell end run