or Connect
AppleInsider › Forums › Software › Mac Software › Can Automator translate multiple files?
New Posts  All Forums:Forum Nav:

Can Automator translate multiple files?

post #1 of 11
Thread Starter 

Hi. I have a very large number of old Apple Works files. I need to translate them to Pages, so I can move on. Just now I am using Mac OS X 10.6.8. Snow Leopard, only because I can still run Apple Works.
Can I use Automator to open and translate a large number of files? (And then move on to Mavericks).
Something like: Take the files in this folder - Open them - Translate each of them to Pages - Place them in this or that folder.
I haven't used Automator much. It doesn't seem so easy to operate to me. 

post #2 of 11

My only concern with a mass-Appleworks script is you losing the file name for each individual file. 


How large is ‘very large’ here?

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply
post #3 of 11
Thread Starter 

It's about 1000 Apple Works text files.

Could you give an indication of how I could make the script?

post #4 of 11

So you’re still on Snow Leopard, which means you don’t have the newest Pages, correct?

 

Crack open AppleScript Editor and paste this in. Then copy ONE of your AppleWorks files to the Desktop or whatever and hit run. Let it go through and see if it converts it correctly. If it does, do ‘em all.

 

on run

    choose file with multiple selections allowed

    my doyourduty(result as list)

end run

 

on open theFiles

    my doyourduty(theFiles)

end open

 

on doyourduty(theFiles)

    

    tell application "Pages"

        repeat with aFile in theFiles

            if (aFile as text) ends with ".cwk" then

                open aFile

                set docName to name of front document

                -- Remove .cwk extension.

                set prevTIDs to AppleScript's text item delimiters

                set AppleScript's text item delimiters to ".cwk"

                -- Add .pages extension.

                set docName to first text item of docName & ".pages"

                set AppleScript's text item delimiters to prevTIDs

                -- Get folder that dropped file exists in.

                tell application "Finder"

                    set sourceFolder to (container of aFile) as Unicode text

                end tell -- Finder

                -- Save file to folder that dropped file exists in.

                set docPathAndName to sourceFolder & docName

                save front document in docPathAndName

                close front document

            end if

        end repeat

    end tell

end doyourduty

 

If, uh… if that doesn’t work, copy this instead.

 

on run

    choose file with multiple selections allowed

    my doyourduty(result as list)

end run

 

on open theFiles

    my doyourduty(theFiles)

end open

 

on doyourduty(theFiles)

    

    tell application "Pages"

        repeat with aFile in theFiles

            if (aFile as text) ends with ".cwk" then

                open aFile

                set docName to name of front document

                -- Remove .cwk extension.

                set prevTIDs to AppleScript's text item delimiters

                set AppleScript's text item delimiters to ".cwk"

                -- Add .pages extension.

                set docName to first text item of docName & ".pages"

                set AppleScript's text item delimiters to prevTIDs

                -- Get folder that dropped file exists in.

                tell application "Finder"

                    set sourceFolder to (container of aFile) as Unicode text

                end tell -- Finder

                -- Save file to folder that dropped file exists in.

                set docPathAndName to sourceFolder & docName

                save front document in docPathAndName

                close front document

            end if

        end repeat

    end tell

end doyourduty


Edited by Tallest Skil - 3/11/14 at 8:20am

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply
post #5 of 11
Thread Starter 

Thank you. I will try it out.

post #6 of 11
Thread Starter 

I appreciate your effort Tallest Skil!

But it is not easy to have AppleScript open the files, as they are created in AppleWorks 3.0.

That means Pages cannot open them.

 

I am beginning to think the only way is to go through everything by hand. 

It is all my work through 11 years as a journalist, so I think I am going to do it in order to preserve it.

When I convert it to Pages it will be searchable in Spotlight.

post #7 of 11
Originally Posted by Sorensen View Post
But it is not easy to have AppleScript open the files, as they are created in AppleWorks 3.0.

 

Yowza. You wouldn’t happen to have a copy of AppleWorks 6.2.9 around, would you?

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply
post #8 of 11
Thread Starter 

Yes, of course. I use AppleWorks 6.2.9.

It opens the files, but for every file, one have to confirm with Enter, that you want to open it. That might be difficult in an AppleScript.

post #9 of 11
Originally Posted by Sorensen View Post
Yes, of course. I use AppleWorks 6.2.9.

It opens the files, but for every file, one have to confirm with Enter, that you want to open it. That might be difficult in an AppleScript.

 

I really feel that there’s a simple way to do this, I just don’t know it.

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply

Originally Posted by Slurpy

There's just a TINY chance that Apple will also be able to figure out payments. Oh wait, they did already… …and you’re already f*ed.

 

Reply
post #10 of 11
Hello,
https://discussions.apple.com/thread/5455245?start=40&tstart=0 contains many scripts which seem to do what you want

Note: If the layout of these documents is simple enough, the latest version of LibreOffice will also open them
Edited by osnola - 3/12/14 at 1:44am
post #11 of 11
Thread Starter 

Thank you, Osnola!

New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Mac Software
AppleInsider › Forums › Software › Mac Software › Can Automator translate multiple files?