HT2488: Mac Basics: Automator

Learn about Mac Basics: Automator
gingermogwai

Q: Automator? Might save my life!

Hi guys, I'm pretty new to mac, a good friend has given me an old G4 and I've been using it to create some more attractive documents for my (until now PC based) business.  Although it's old it's a cracking machine (if a little noisy) for performing simple tasks in iWork applications - and that's all I ask of it! One thing I need to do is undertake calculations in a numbers spreadsheet for my quotes, then transpose some of that data to a pages document for submission to clients.  At the moment I am doing that 'long hand'.

 

So my question is: Am I able to use Automator to pull data from the numbers sheet, transpose it to a template document, then email that document in PDF to my client(s)?

PowerMac, Mac OS X (10.4.11)

Posted on Feb 15, 2012 9:46 AM

Close

Q: Automator? Might save my life!

  • All replies
  • Helpful answers

  • by twtwtw,

    twtwtw twtwtw Feb 18, 2012 3:17 PM in response to gingermogwai
    Level 5 (4,935 points)
    Feb 18, 2012 3:17 PM in response to gingermogwai

    well, this can be done in applescript t least partway (I am not aware of any automator actions having been made for iWork). Can't really do it in the abstract, though.  in principle, you'll need to specify the range of numbers you want to process, run whatever calculations you want to run, save the result to a text file, and then send it through cupsfilter to generate a pdf.  skeleton looks something like the following:

     

    tell application "Numbers"

              tell document 1

                        tell sheet 1

                                  tell table 1

      --select the data you want to process and process it

                                  end tell

                        end tell

              end tell

    end tell

    tell application "Pages"

      --insert data as appropriate, and save as a text file in variable filePath

      --might be easier to do this without pages if it's just a simply lightly formatted list of numbers

    end tell

    do shell script "cupsfilter " & filePath

     

    but I can't really be more specific unless you are.