How to convert a Safari saved website into Textedit rtfd

I already saved several hundred of pages I need in different folders
I’d like to create a script which

1st find the saved pages in the subfolders within the main folder I put them
2nd copy each file in a new folder keeping the original file name
3rd the copy mast be in the Text edit RTFD format: is a container separating text and images usuful for later operations
4th move to the next subfolder when all files in the previous are processed

All the webpages come from the same website
according to this:
mainfolder->France->Paris->RuedeRennes.website
then
mainfolder->Spain->Barcellona->Diagonal.website

and so on

The various xxxx.website files have exactly the same html format. For me is easy to use other scripts I have to extract from the container the information I need to get.

I’d like to be able to get this result

mainfolder_copy->France->Paris->RuedeRennes.rtfd

and so on

I guess is rather easy but Automator doesnt help me and I feel lost

thanks a lot

DEanwan

Model: Mac Pro, Quad-Core Intel Xeon
Browser: Safari 533.19.4
Operating System: Mac OS X (10.6)

I just showed someone how to convert html into webarchive. The same applies for you. You can convert to rtfd using the same tool. See here. Regarding the rest, each task is easy and some searching should give you answers. Just work through it one step at a time and use what I showed for the actual conversion. Good luck.

thanks regulus but probably I didn’t explain my problem properly

I already have the files with a “.webarchive” extension
I need to convert them as “.rtfd” files to extract separately the various elements there.

I can do it manually opening each page at the time in safari
then copy
then paste in Text edit as the resulting document probably via clipboard returns a “container” where all elements in the webpage are properly divided in a “text.rtf” file and a series of images.

I have additional working script which allow me to get the infos I need but the saved safari files with the “.webarchive” extension are not containers so I cannot use my scripts to process them as needed

Is there a way to modify your script to get a result starting for a “XXXXXX.webarchive” file to a “XXXXX.rtfd” file?

This will solve all my problems

else I need to do it manually and the pages are hundred

thanks again for your help

Model: Mac Pro, Quad-Core Intel Xeon
Browser: Safari 533.19.4
Operating System: Mac OS X (10.6)

Yes, that’s why I suggested it. Wherever it says “html” in my script, replace that with “webarchive”. And wherever it says “webarchive” replace that with “rtfd”.

thanks it works perfectly

textutil is great, but TextEdit can do this specific conversion on its own.

Have it open the webarchive, then select ‘save as’, and in the popup at the bottom of the navigation sheet select “rtf with attachments”