Automator error renaming file extension

I've got an automator script that I made to batch rename the extension name of files. Every time I run it I get "The action 'Copy Finder Items' was not supplied with the required data." appears and the script fails to work. I'm using the instructions I found here to make the script becaue I have never used Automator. I've attached an image of the automator page I'm working with.


User uploaded file


Thank you!

10.9.1

Posted on Jan 10, 2014 3:11 PM

Reply
15 replies

Jan 10, 2014 3:50 PM in response to Balaamsdonkey

If you are going to replace text in the file extension, then you need to use the specific text (the existing extension or part of the extension) that you are wanting to replace. I can't tell what the current extension(s) are in your screenshots - if they don't have a file extension or have various extensions, take a look at using the Name Single Item option of the rename action and just set the extension to whatever. Note that changing the extension will not change the file to a pdf if it isn't already.

Jan 10, 2014 4:40 PM in response to Balaamsdonkey

The linked article is about right, you just need to use the actual name extension of the file(s) you want to change. The kind of file (Application, Folder, Document, etc) is not the name extension - You can always see the full name of the file (including any extension, even if hidden) in the Name & Extension part of the Get Info window.


If you are not renaming the extension, but are changing the whole thing instead, the Name Single Item option of the Rename Finder items action is what you are looking for - that will let you set just the extension .

Jan 10, 2014 5:05 PM in response to Balaamsdonkey

That preview looks like a pdf. A pdf falls under the category "document." Finder is making a mistake in assuming the default to open with is textedit. Are you able to open it in preview?


Assuming all the files in this folder are pdfs, this is what you want to do:


cd /path/to/folder

for file in *; do mv "$file" "${file}pdf"; done

Jan 10, 2014 5:17 PM in response to Balaamsdonkey

Although Mr. nbar seems determined to have you use a Terminal soution, he forgot about a test you can use - from the Terminal, you can paste in the following command (there is a trailing space), then drag one of the suspect files to the Teminal window (to paste the path) and then press return.

file -b


Alternately, you can paste the following sctipt into the AppleSctipt Editor and run it to check a file:


display dialog (do shell script"file -b " & quoted formofPOSIX pathof (choose file))


Both will use the file utility to make a guess about what the file is based on its formatting.

Jan 10, 2014 5:37 PM in response to red_menace

In response nbar: The files open in Preview if open them as-is.


The files seem to be gifs. I tried your command in AppleScript but couldn't select more than one file at a time.


In reponse to your suggestion to change the name in the information panel: that would defeat the purpose of the exercise. I want to change multiple files at once to.pdf and if I'm going to go into each file and change the extension to something I might as well change it to .pdf while I'm there.

Jan 10, 2014 5:48 PM in response to Balaamsdonkey

The snippets I posted just check a particular file to see what kind it is (to see if they really are PDFs).


If all of the files are GIFs, giving them a pdf extension won't change them to PDFs. There is a New PDF from Images action that will convert the file, but your workflow will get a bit more complicated because that action doesn't keep the original name. Of course, you can also just add gif extensions to the file (if that is what they all are).

Jan 11, 2014 2:27 PM in response to red_menace

FYI, page 343 from the journal Speculum 5:4 (Oct. 1930) in Balaamsdonkey's examples is certainly a GIF. I checked JSTOR for the article. The "Page Scan" option for p. 343 delivers a GIF of 52,164 bytes--just as in BD's second and fourth posts. But if BD uses JSTOR or a similar database to access Speculum, I'd advise choosing the database's "Article PDF" option to download a true, searchable PDF rather than a series of page-by-page (and unsearchable) GIFs.


--A medievalist

Jan 11, 2014 7:26 PM in response to Balaamsdonkey

I tried your command in AppleScript but couldn't select more than one file at a time.


I should have been clearer. Run this command directly in the terminal, not through automator.


I want to change multiple files at once to.pdf

That's exactly the command does, it batch changes extensions (again, this is not conversion - if that's what is required) - see red_menace's helpful suggestion.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator error renaming file extension

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.