Automator/Applescript for Pages

Does anyone know of a good reference for Automator Actions or Applescripts for Pages? I've looked at all the usual websites and no one has any. All I'm trying to do is use a script to automate the process of opening Word docs and save them as Pages files.

I do not think there is anything really well written and exhaustive on the matter. I have three main sources:
1. Pages script dictionary (available in ScriptEditor through Open Dictionary > Pages).
2. This page with a script that goes the opposite way: http://pagesfaq.blogspot.com/2006/11/i-have-one-thousand-pages-documents-to.html
3. Searching Google for the string "tell application Pages".

Similar Messages

  • Help Needed: Automator Applescript for Folder Action - Encode Video

    Hi !
    I have created an Automator Applescript for a Folder Action to do the following:
    When a new video file is moved to the target folder (i.e. Download of Vuze is done), automatically launch the Applescript Action that does the followin g(Applescripted):
    1) Using "run shell script" and FFMPEG on a UNIX command line, determine Width/Height, Framerate, Bitrate
    2) Calculate encoding parameters (slightly reduced bitrate, reduced Aspect etc.)
    3) Using "run shell script" with ffmpeg on the command line and the calculated parameters to encode the video file
    At the same time, the action is written to a log file so I know if a file is recognized, when encoding started etc.
    It works fine if I save this Action as an .app, make an alias on the Desktop and drop video files on it.
    It also works fine if I attach the script to a folder as a folder action and drag a video file in there.
    However, when I attach the script as a folder action to the Vuze download folder, it encodes only some video files, i.e. if there was a download of 5 files, chances are good that it will not encode 1 or 2 files out of those 5.
    If for example a second download finishes while the encoding for the first download is still going on, sometimes the second file starts encoding after the first encode finishes, sometimes it does not, the file does not make the log file at all, i.e. the folder action missed it or the automator action dropped it because it was still encoding. Still, sometimes it happens, sometimes not.
    As I need a solution that is 100% accurate, I would like to ask if there are any ideas on how to do this better maybe? As I am not an Applescript Guru, I would need some help to know what works and what doesn't and what the syntax is.
    My main idea right now:
    Similar to how ffmpegX works with its "process" application, have a second script (as .app) that receives the files to be encoded from the automator action and puts them in a queue, then proceeds to encode this queue while the main automator action is free to receive the next file.
    Writing this second app is quite straightforward (a modified version of my current script) but I have some questions I need help with:
    1) How do I call another applescript from within an existing applescript that launches the new applescript in a new process?
    2) How do I pass parameters to this new applescript?
    3) In case of this "Queueing" Idea, once I called the external applescript the first time, how do I make sure when I call next time, that I don't open a second instance of this script but rather pass another queue item to the original instance to be processed?
    Or in general: Is there a better way to achieve this automatic encoding solution that I have not thought about?
    Alternatively:
    Does anyone know how to call the "process" application that comes with the ffmpegX package with the correct parameters to use as a queueing / processing tool?
    Thanks!
    Joe
    Message was edited by: Joe15000
    Message was edited by: Joe15000

    To do this, I created an Automator workflow with an Applescript snippet to change the 'media kind'.
    Here is the 'Run Applescript' workflow step code:
    on run {input, parameters}
              tell application "iTunes"
                        set video kind of (item 1 of input) to movie
              end tell
              return input
    end run
    Prior to this running, I have an 'Import Files into iTunes' workflow step.
    You can switch out 'movie' with: 'TV show', 'music video', or anything in ITLibMediaItemMediaKind.
    Good luck,
    Glenn

  • Automator/AppleScript for adding code to an html file

    Hi all,
    I have a bunch of files (60+) that have been converted from xml to html so that they can be read by the calibre eBook software. Because they were originally .xml files, they do not have opening or closing htiml or body tags. They won't open in Word, only textedit. I am looking for a way to insert the <html> <body> and </body> </html> codes into each file as quickly/painlessly as possible, ideally as a workflow, or series of workflows, that I could use later with other files of this type.
    Can anyone advise me on how to do this? I'm new at coding/applescript/automator, but I'm generally a quick study.

    This is an applescript version which should be a little more comprehensible.
    -- select files - might be easier ways to do this depending on your setup
    set fileList to choose file with prompt "Choose files to wrap in HTML tags" with multiple selections allowed
    -- loop through files
    repeat with thisFile in fileList
      -- open the file for writing
              set fp to open for access thisFile with write permission
      -- grab contents of file and wrap it in tags
              set unmodifiedText to read fp
              set modifiedText to "<html>" & return & "<body>" & return & unmodifiedText & return & "</body>" & return & "</html>"
      -- write the new text out to the file and close it.
              set eof of fp to 0
              write modifiedText to fp
              close access fp
    end repeat

  • Automator Actions for Pages

    I just checked in Automator, and I can't find a single Pages Automator action.
    With how useful it could be I can't fathom why there wouldn't be some built in.

    I don't know about third-party actions created for them, but Automator does show some actions from Keynote. There no actions from Pages or Numbers in Automator when I review the listing.
    Actions for Keynote include (21 total):
    Add Chart to Slide
    Add File To Slide
    Add Slide to Keynote Presentation
    Change master of Keynote slide
    Close Keynote Presentation
    Create Image Slide
    Delete Slide
    Extract Notes
    Make New Keynote Presentation
    Move Keynote slide
    Open Keynote Presentations
    Print Keynote Presentation
    Quit Keynote
    Save Keynote Presentation
    Set Slide Title
    Set Transition for Slide
    Show Next Keynote Slide
    Show Previous Keynote Slide
    Show Specified Keynote Slide
    Start Keynote Slideshow
    Stop Keynote Slideshow
    In general, actions are usually a part of the application, so no need to install separately unless the actions are supplied afterwards.

  • Applescript for pages 09, avoid hanging text in letters

    When I use applescript to generate letters, I occasionally get a 2-page letter where the signature line is hanging by itself.
    e.g. :
    page 2
    Sincerely,
    My Name
    But it should be:
    page 2
    Thank you for your help with this matter
    Sincerely,
    My Name
    In my script, I have a routine to manually stop the script execution while I inspect the letters greater than 1 page, print them if they're ok, and save them to manually put in the page break before the last line, if necessary.
    Anyone have a way to automate this? Thanks

    OK, you couldn't leave well enough alone
    I had to think hard on this, because not all my documents end the same way. Some are letters, ending with
    Thank you very much for letting me help...
    Sincerely,
    (my name)
    others just are chart notes, ending with
    (my name)
    so the ends of the documents have different text strings.
    So, this is what I came up with, & it works, so thanks for the suggestion
    try
    tell application "Pages"
    tell front document
    set n to character offset of first paragraph where it starts with "Thank you very much"
    set the_text to a reference to the text from (character n) to (the last character)
    set (keep with next paragraph) of every paragraph of the_text to true
    end tell
    end tell
    on error
    tell application "Pages"
    tell front document
    set n to character offset of first paragraph where it starts with "[my name]"
    set the_text to a reference to the text from (character (n - 6)) to (the last character)
    set (keep with next paragraph) of every paragraph of the_text to true
    end tell
    end tell
    end try

  • Learning Unix commands (and automator/applescript) for a dummy :-)

    Hi:
    I've been supporting macs for many years and have done mostly user end support with all the various GUI tools. I've never been a programmer, never had the mind for it, etc.
    However, I've now reached the point where I need to do some kind of scripting and I'm looking for some good learning/training tools. I was wondering if anyone might have suggestions about the best training / reference guides to go about doing this. Right now, it's as if I need to play a little Beethoven, haven't learned Chopsticks yet and I'm trying to find out how to play chopsticks while learning a little Beethoven at the same time. (how's that for a metaphor?)
    For example: For my first project, I have to set up a backup for some laptop users so that certain files will be backed up. The need is different for each user, so this is why setting up a script would be easiest. My goals in the setting up this project are:
    - Make the script run at logout (logout hook)
    - check to make sure the network volume I want to backup to is present; if not present, stop the script
    - Use either cp or rsync to copy the files/directories to the shared volume.
    I've tried to look around the internet for help, examples, etc, but I've been unable to put together exactly the commands I need to sue to accomplish my task.
    Any suggestions would be great.
    Thanks!

    If you already know something about unix commands, there is a scripting tutorial at http://www.tldp.org/LDP/abs/html/index.html
    If you need a tutorial on unix commands, http://osxfaq.com/Tutorials/LearningCenter/UnixTutorials/LoseTheMouse/index.ws had a pretty good tutorial, although at the moment, that link isn't loading for me now so I don't know if it is still up online or not.
    for creating logout hooks, http://www.bombich.com/mactips/loginhooks.html might help.
    Also, in Terminal, type man launchd.plist if you can think of a scenario where you could implement a "cron-like" solution. Then refer to Apple's own periodic daily/weekly/monthly launchd plists (com.apple.periodic-*ly.plist) at/System/Library/LaunchDaemons/. There are more triggers available than just day/date/time, such as "watchPaths" and "RunAtLoad." Home grown launchd plists ones should go in /Library/LaunchDaemons/ or Library/LaunchAgents, not /System/Library/LaunchDaemons/. Also man launchd (no ".plist").

  • Please, can Apple give explanations about dropping Applescript support for Pages 13!!??? It is paramount, please do something to fix it asap!!!

    Please, can Apple give explanations about dropping Applescript support for Pages 13!!??? It is paramount, please do something to fix it asap!!!

    You might want to check your firmware version. Go to: Settings>General>About. Look at the version field, it should be: 5.0.1(9A406). If it's 9A405 you need to update the firmware by connecting your phones to iTunes and updating it. This worked for me as I work on a ship and don't have a signal inside. I was having to do your little trick many times during the day when I would go outside to check for messages.

  • Dropping Applescript support for Pages

    apple new suite is grate!, but as it does not have Applescript support for Pages I can no longer use my citations tools and that makes pages '13 useless for me. Are you going to fix that at any time soon?

    PeterBreis0807 wrote:
    Hard to add AppleScript support for things that simply are not there.
    True. However, if you look at the Applescript dictionary for Pages '09, most of the objects are still there in the UI in Pages 5 even though there is no way of scripting them. It seems there simply was no time to get them into the scripting dictionary. The citation tools of Guchi922 may not be supported, however.
    If Apple implements all the objects they can in Pages 5' scripting dictionary, another question arises: Will there be much compatibility with scripts written for Pages '09, and there I do not dare being an optimist.

  • 'Automator' use with Pages, Numbers & Keynote!

    I am trying to create a workflow that auto inputs data from an Excel spreadsheet to a Pages document, only to discover that there appears to be no ability to integrate with Pages and other iWork's applications within the Automator application.
    Am I correct in this assumption?
    Why is this?
    Will we see this capability in the future?
    It's seems totally insane to create such a powerful tool, that cannot be used with Apple's own software packages, but that can integrate with Microsoft packages! Missing a trick here Apple??
    Any help would be much appreciated.
    James

    The AppleScript scripting definitions, and Automator actions associated with Office for Mac 2011 applications were created by Microsoft. The same entities for Pages, Numbers, and Keynote were created by Apple. Not having Office for Mac 2011 installed will deprive you related Automator/AppleScript functionality.
    Apple's commitment to document integration is the ability to import Microsoft documents into the respective Pages, Numbers, and Keynote applications. In your case, getting Excel into Numbers, and then base your workflow around Numbers and Pages.
    Assuming that one has Office for Mac 2011 installed, those that are patiently nimble with AppleScript, can open an Excel document, and a Pages document in the same AppleScript code, and to the extent that the respective scripting definitions interplay without data type collisions, you may be able to create something unique. Mary Shelley, the English author published a novel about that calamity in 1818.

  • Applescript: open Pages doc from Templete, change filename and replace text

    Hi!
    I just got started with applescript and i want a script that does the following:
    1. open "choose from list" dialog to choose the topic of my document
    from 4 possibilities (here for example A, B, C, D)
    2. open document from TemplateXY
    3. set document name with date and topic (dd.mm.yyy) "16.02.2011 - A"
    4.inside of document: replace text "date" with the currend date (dd.mm.yyy)
    and the text "topic" with the topic chosen in (1.) "A"
    this is what i already did:
    here as colored screenshot:
    http://i55.tinypic.com/2mnhxkm.jpg
    set datum to do shell script "date \"+%d.%m.%Y\""
    --choose topic:
    set chosentopic to choose from list {"A", "B", "C", "D"}
    --text "topic" becomes replaced throug variable topic
    set searchstringT to "topic"
    set replacestringT to chosentopic
    --text "date" gets replaced by currend date (variable datum)
    set searchstringD to "date"
    set replacestringD to datum
    --open pages, define filename & do search&replace of the strings defined above
    tell application "Pages"
    activate
    set DocName to datum & " - " & chosentopic
    set (every text where it is searchstringT) to replacestringT
    set (every text where it is searchstringD) to replacestringD
    end tell
    the "choose from list" dialog works and the variables like topic, datum and the search&replace strings get defined as well
    my problems are:
    i only get an error that the text could not be replaced
    i dont know how to get a new document from a template and how to get its filename changed
    i really just started doin things with applescript for a day so i hope you can help me
    regards
    DaNylz
    Message was edited by: DaNylz

    Try something like this:
    set myFoundItems to change text text of all page items of pages 3 thru 5 of document 1
    Shane Stanley <[email protected]>
    AppleScript Pro Sessions <http://scriptingmatters.com/aspro>

  • Announcing New! Oracle Policy Automation Connector for Oracle CRM on Demand

    Hi all,
    We are very pleased to announce the immediate availability of the new OPA connector for Oracle CRM on Demand. You can find more information and the link to download this connector on the OPA pages on OTN here:
    http://www-content.oracle.com/technetwork/apps-tech/policy-automation/overview/index.html.
    Feel free to post to this forum with questions or comments on this new connector. We welcome your feedback.
    Kind regards,
    Davin Fifield
    VP Product Development, OPA

    1. Oracle Policy Automation Connector for Siebel v10.2 requires rulebases to be created with Oracle Policy Modeling 10.2.
    2. Siebel and OPA are separate applications with their own system requirements. There is no need for them to be deployed on the same operating systems / application servers.
    3. The siebel-data-adapter.properties file is found in, for example, the siebel-wd-embedded.war files (for Java) in the location described in the documentation, and in the corresponding .zip files (for .NET).
    Note that Oracle Policy Automation Connector for Siebel v10.3 is planned to be available on E-Delivery within a few weeks.
    Davin.

  • Applescript with Pages

    I'm trying to write an Applescript program that will manipulate the color of text based on certain external factors. Does anyone know how to set the text color of a paragraph using applescript?

    I apologizes for English speaking users but when I met a french asker, I feel free to use French.
    Bonjour
    (1) Ravi de voir que vous avez constaté que le programme évoqué n'est pas un outil sérieux ce qui m'a conduit à le rebaptiser Bentoy
    (2) Désolé mais dans le dictionnaire Applescript de Pages, il n'y a pas de commande merge
    Ce que vous souhaitez réaliser impose le recours au GUIscripting.
    Pour être viable, cela suppose que vous ayez défini tous les paramètres lors d'une opération de fusion effectuée à la main.
    (3) Il y a peut-être une solution de rechange.
    Allez sur mon idisk :
    <http://public.me.com/koenigyvan>
    téléchargez :
    ForiWork:For_Pages:fusion_dansPages.zip
    J'avais écrit ce script pour iWork '09 quand il n'existait pas de fonction fusion entre Pages et Numbers.
    Il devrait être facile d'adapter la bête à votre problème et la création d'un document Numbers serait inutile.
    À priori, le plus facile à adapter est le script version 1.
    La version 2 manipule le fichier index.xml du document Pages et n'a pas été mis à jour pour prendre en considération les changements introduits par iWork '09.
    Yvan KOENIG (VALLAURIS, France) jeudi 4 novembre 2010 17:59:24

  • Does anyone have automator workflows for iWork Numbers that will run in Lion?

    Does anyone have automator workflows for iWork Numbers that will run in Lion?

    can you be a little more specific as to what your looking to do? There are some great Applescript gurus on this forum that are very able to help with automating numbers.
    Jason

  • AppleScript for mail merge with Excel data?

    Is there any approach for an AppleScript that lets you use Excel data as source for some kind of mail merge operations? If not, would anyone here be interested if someone (I?) would take a closer look at some kind of a (AppleScript Studio) solution for this?

    I'm not sure I get the question.
    If it is "could you use AppleScript to create mail merge for Pages with Excel?", the answer is, Yes. Both Pages and Excel are scriptable.
    If the question is "has anyone done it yet?", I don't know, but it could be a fun exercise.
    If the question is "would there be a market, if someone (you?) wrote and released such a script?", I cannot tell, but personally I would probably write a hack that worked only for my own needs - if I had them. The overhead with usability, testing, different address formats, languages, different Excel sheet formats, and so on, makes me guess that the investment wouldn't pay off for a generic solution. Especially considering both Pages and MS Office already have their own mail merge functions.

  • AppleScript for mail merge

    What is AppleScript for mail merge

    AppleScript is a programming language that is tied to certain Applications that support it. Pages v5.5.1 has a scripting dictionary of the terms it will support via AppleScript. Apple's answer to not including Mail Merge functionality in Pages v5.5.1 is for individual users to roll their own, download an example and adapt it, or use another application with built-in Mail merge features.
    See my previous post to you.

Maybe you are looking for

  • Import java.io.file ??

    Hi, While I'm doing this course I'm trying to do more programs, in order to learn more about RPI, and I have a problem. I'm trying to acces to some files with threads, one to read the file and another one to read the file. The problem I get is when I

  • Why isn't the Submit button submitting responses?

    I created an evaluation form using Forms Central and distributed it. 4/5 respondents filled it out with no problems. The last person filled it out twice and lost her responses once through an error on her end and the second time she doesn't know why

  • Estimation Technique for ABAP programmimng

    Hi, I would like to know if there are any formal software estimation techniques that may be used for ABAP development.The commonly used estimation techniques such as Function Point/LOC etc do not seem to fit in.We currently use WBS methodology but he

  • Macbook standard desktop won't be displayed

    Hello all, I installed an anti virus on my Macbook Air. It is a 2013 with Mavericks version 10.9.2  After this installation I restarted the Mac and it does not display the normal desktop. I would like to uninstall the app(anti virus) but know I shoul

  • Question on Blend For Visual Studio 2012

    Hi, I am using "start here Visual Basic 2012" I am making an animated picture with a button. the button, when pushed will cause a picture of a chicken to move.  On page 118 it says to double-click the Click event handler text box for the button which