I've made an Automator service for extracting PDF text and saving it in the current directory, and it works reasonably well.
It takes one or several PDF files, extracts the text, and saves it as separate .rtfs placed in the same directory as where the original PDFs was found.
Fine, excellent, except for one small rub: what is invariably also saved alongside the other .rtfs is an empty one (zero bytes), with the name of the current directory.
Looking at the workflow below, it seems like both variables ("PDF" and "Bane") are passed to the action "Hent ut PDF-tekst". Is my assumption reasonable, and in any case, how do I fix it?
The script in plain text:
on run {input, parameters}
tell application "System Events"
set thePath to POSIX path of (container of (item 1 of input))
end tell
return thePath
end run
As an aside, Automator automatically creates a PNG representation of your workflow when you save it, and it can be easily got at by revealing the package contents.
Genius me realized this only after a bit of faffing about with screen capture and GIMP.