MACSCRPT Archives

March 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Alain Schremmer <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 28 Mar 2006 20:46:47 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (75 lines)
I am totally new to Applescript and to this list, so ...

Here is my situation. In making figures for a book that I am LaTeXing to 
put on the web under GPL so that I need both a print version and an 
editable version, I have the following work flow:

1) When I make the first picture in a series

    I create the file in Intaglio,
    + I click Save As  to get the editable file and enter the filename,
    say Picture1.Intaglio
    + I click Save A Copy As to get the LaTeX-includable file as
    Picture1.pdf.
    + I click Close the Intaglio file
    + I click on the already open LaTeX file with the
    \includefigure{Picture1.pdf} command
    + I click on the Typeset button there to see the output with the
    picture.

In addition to being Applescriptable, Intaglio remembers:

    To put the appropriate extensions: .Intaglio on Save As and .pdf on
    Save A Copy As (in addition to cropping the pdf to content size)
    To Save As in the folder called Graphics
    To Save A Copy As in the folder called Figures

2) When I make the second picture in the series,

    I open, say, Picture1.Intaglio
    I click Save As (Shift Command S) -- and change the filename to,
    say, Picture2
    I make the modifications
    * I click Save (Command S)
    * I click Save A Copy As (Alternate Command S)
    * I click Close
    * I click on the already open LaTeX file with the
    \includefigure{Picture2.pdf}
    * I click on the Typeset button there to see the output with the
    second picture in the series.

3) When I edit an existing picture,

    I open, say, Picture1.Intaglio
    I make the modifications
    ^ I click Save
    ^ I click Save A Copy As
    ^ I click Replace
    ^ I click Close
    ^ I click on the already open LaTeX file with the
    \includefigure{Picture1.pdf} command
    ^ I click on the Typeset button (Command T) there to see the output
    with the modified picture.

So, with already a couple of hundred pictures, that's a lot of clicking 
and I thought that I should write three keyboard commands, for +, * and ^.

I bought two books Applescript for dummies and Applescript, The Missing 
Manual, macroed what I was doing and am completely stuck because, of 
course, the macro recorder recorded specific information--and I didn't 
even try to typeset the LaTeX source (TeXShop is Applescritpable too):

    tell application "Intaglio"
        activate
        save document id 139 in file "Macintosh
    HD:10_OMTo:4.MATH4LEARNING.tex:10.0:Graphics:Picture2.intaglio"
        save document id 139 in file "Macintosh
    HD:10_OMTo:4.MATH4LEARNING.tex:10.0:Figures:Picture2.pdf" as PDF
    picture with crop
    end tell

I would appreciate any hint.

Hopeful regards
--schremmer

ATOM RSS1 RSS2