I'll include one of these scripts below, for reference. The Finder part of the script still works as expected, but once it gets to the Pixelmator script, nothing else happens.
on run {input, parameters}
set desktopPath to (path to desktop as text)
set folderPath to desktopPath & "Frames"
set exportFolder to ""
tell application "Finder"
if (exists folderPath) is false then
make new folder at desktopPath with properties {name:"Frames"}
end if
set exportFolder to folder folderPath
end tell
tell application "Pixelmator Pro"
set animationFile to front document
set framePrefix to (exportFolder as text) & name of animationFile
set visible of (every group layer of animationFile) to false
repeat with a from 1 to (number of group layers of animationFile)
tell animationFile
if (a > 1) then
set visible of currentFrame to false
end if
set currentFrame to item a of group layers
set frameName to name of currentFrame
set visible of currentFrame to true
end tell
export for web animationFile to file (framePrefix & frameName & ".png") as PNG
end repeat
set visible of (every group layer of animationFile) to true
end tell
return input
end run