Apple Script to make Pages open in a user-selected screen position

This is a follow-up to a response/script made previously by Yvan KOENIG that enables Pages to open a Pages template in a user-selected "left" position.
http://discussions.apple.com/message.jspa?messageID=9100331#9100331
This works great for me, but I'd like to take this one step further, if possible. I'm naïve when it comes to Apple Scripts
Currently, if I use the script, it opens up in 100% 'fit-width' view as follows:
http://trials.sent.com/pages/100.png
What I'd like it to do is to open up in 125% 'fit-width' view as follows:
http://trials.sent.com/pages/125.png
I'd like to therefore ask if it's possible to somehow enable this in the script above.

I looked at the English version.
Let me say you that you are a funny guy.
Set width and set "Fit Width" are incompatible commands.
On my 1920 x 1200 screen, if I set scale to 125%, Fit Width is disabled.
If I check "Fit width", the size remains unchanged but is no longer selected.
On a smaller display, "Fit Width" will set the page in the "100%" mode.
My guess is that it's what you get.
As I am a good guy,
I add some instructions in the code.
Now you may activate several settings to fit your needs (when they are technically compatibles).
--(SCRIPT openToLeft.app]
Enregistrer le script en tant que Script, Application ou Progiciel : openToLeft.xxx
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
menu Scripts > Pages > openToLeft
Le script créera un nouveau document à partir du modèle choisi et le poussera à gauche de l'écran.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
+++++++
Save the script as a Script, an Application or an Application Bundle: openToLeft.xxx
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
menu Scripts > Pages > openToLeft
The script will create a new document from the selected template and will push it to the screen's left edge.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
+++++++
Yvan KOENIG (Vallauris FRANCE)
4 mars 2009
property theApp : "Pages"
property hardCoded : false
true = the template is predefined
false = you select the template when you run the script *)
property zoomIt : false
false = leaves the doc size as created
true = issue a cmd + > command to enlarge it *)
--=====
on run
my activateGUIscripting()
tell application "Pages"
set Templates_loc to localized string "Templates" (* nom local du dossier "Modèles" *)
set MyTemplates_loc to localized string "My Templates" (* nom local du dossier "Mes Modèles" *)
end tell -- theApp
set templatesFolder to ((path to application support from user domain as text) & "iWork:Pages:" & Templates_loc & ":" & MyTemplates_loc & ":")
if hardCoded then (*
Here the template to use is hard coded in the script *)
if templatesFolder does not end with ":" then set templatesFolder to templatesFolder & ":"
set myTemplate to (templatesFolder & "un modèle09.template:") as alias
else (*
Here we are urged to choose the template in a dialog *)
set templatesFolder to templatesFolder as alias
Don't ask me why, Pages uses two Universal Type Identifiers for its templates
the first one is used if only Pages '08 is installed under 10.4 or by both '08 and '09 under 10.5.6
the second one is used under 10.4.11 if Pages '09 is installed *)
set allowed to {"com.apple.iWork.Pages.template", "com.apple.iWork.Pages.sfftemplate"}
if 5 > (system attribute "sys2") then
set isOs4 to true
set permitted to allowed
else
set isOs4 to false
set permitted to {}
end if
if my parleAnglais() then
set myTemplate to choose file "Choose a Pages template …" of type permitted default location templatesFolder
else
set myTemplate to choose file "Choisissez un modèle Pages …" of type permitted default location templatesFolder
end if
if not isOs4 then
due to a system's bug, choose file is unable to filter the iwork's files UTIs
So we must check by ourself *)
set maybe to myTemplate as text
tell application "System Events" to set typid to type identifier of disk item maybe
if typid is not in allowed then
if my parleAnglais() then
error "The file “" & maybe & "” is not a Pages template !"
else
error "Le fichier « " & maybe & " » n’est pas un modèle Pages !"
end if
end if
end if
(* Here, the pathname of the template is of class alias *)
end if -- hardCoded
try
tell application "Pages"
activate
set n to count of documents
open myTemplate (* create a new doc from the template *)
repeat
if (count of documents) > n then
exit repeat
else
delay 0.1
end if
end repeat
tell window 1 (*
As we are telling to application "Pages" we may use tell window 1 even if we have an Inspector or a Find/Replace dialog open.
It would be wrong if we where telling to process "Pages" *)
set {x1, y1, x2, y2} to get bounds
set bounds to {0, 0, x2 - x1, y2 - y1} (* move the window to the left edge *)
set view scale to 125.0
--set fit page to true (* or false *)
set fit width to true (* or false *)
--set full screen to true (* or false *)
--set outline visible to true (* or false *)
--set ruler visible to true (* or false *)
--set styles visible to true (* or false *)
--set thumbnails visible to true (* or false *)
--set toolbar visible to true (* or false *)
--set two up to true (* or false *)
end tell -- window
end tell -- application
end try
end run
--=====
on activateGUIscripting()
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true (* to be sure than GUI scripting will be active *)
end tell
end activateGUIscripting
--=====
on parleAnglais() (* Check if Pages is running in French *)
local z
try
tell application theApp to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE jeudi 14 mai 2009 11:35:36)

Similar Messages

  • Any way to make Pages always open in a user selected screen position?

    It is a continuing irritation to have to close the Styles Drawer, drag the window all the way to the left of my screen, and reopen the Styles Drawer on the right. This is the way I need to work and I'm not going to change that. What I'm hoping is that there is some way to reset the default opening position, maybe in terminal? Or an AppleScript? Neither of which I am familiar enough with to create my own. Any suggestions?
    TIA

    Here is a commented and enhanced version.
    --(SCRIPT openToLeft.app]
    Enregistrer le script en tant que Script, Application ou Progiciel : openToLeft.xxx
    déplacer l'application créée dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
    Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
    menu Scripts > Pages > openToLeft
    Le script créera un nouveau document à partir du modèle choisi et le poussera à gauche dde l'écran.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++
    Save the script as a Script, an Application or an Application Bundle: openToLeft.xxx
    Move the newly created application into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
    Maybe you would have to create the folder Pages and even the folder Applications by yourself.
    menu Scripts > Pages > openToLeft
    The script will create a new document from the selected template and will push it to the screen's left edge.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    +++++++
    Yvan KOENIG (Vallauris FRANCE)
    4 mars 2009
    property theApp : "Pages"
    property hardCoded : false
    true = the template is predefined
    false = you select the template when you run the script *)
    --=====
    on run
    if hardCoded then (*
    Here the template to use is hard coded in the script *)
    if my parleFrancais() then
    set templatesFolder to (path to application support as text) & "iWork:Pages09:Modèles:Mes modèles:"
    else
    set templatesFolder to (path to application support as text) & "iWork:Pages09:Templates:My Templates:"
    end if
    if templatesFolder does not end with ":" then set templatesFolder to templatesFolder & ":"
    set myTemplate to (templatesFolder & "un modèle09.template:") as alias
    else (*
    Here we are allowed to choose the template in a dialog *)
    if my parleFrancais() then
    set templatesFolder to ((path to application support from user domain as text) & "iWork:Pages09:Modèles:Mes modèles:") as alias
    else
    set templatesFolder to ((path to application support from user domain as text) & "iWork:Pages09:Templates:My Templates:") as alias
    end if
    Don't ask me why, Pages uses two Universal Type Identifiers for its templates
    the first one is used if only Pages '08 is installed under 10.4 or by both '08 and '09 under 10.5.6
    the second one is used under 10.4.11 if Pages '09 is installed *)
    if my parleFrancais() then
    set myTemplate to choose file "Choisissez un modèle Pages …" of type {"com.apple.iWork.Pages.template", "com.apple.iWork.Pages.sfftemplate"} default location templatesFolder
    else
    set myTemplate to choose file "Choose a Pages template …" of type {"com.apple.iWork.Pages.template", "com.apple.iWork.Pages.sfftemplate"} default location templatesFolder
    end if
    (* Here, the pathname of the template is of class alias *)
    end if -- hardCoded
    try
    tell application "Pages"
    open myTemplate (* create a new doc from the template *)
    tell window 1 (*
    As we are telling to application "Pages" we may use tell window 1 even if we have an Inspector or a Find/Replace dialog open.
    It would be wrong if we where telling to process "Pages" *)
    set {x1, y1, x2, y2} to get bounds
    set bounds to {0, y1, x2 - x1, y2} (* move the window to the left edge *)
    end tell -- window
    end tell -- application
    end try
    end run
    --=====
    on parleFrancais() (* Check if Pages is running in French *)
    local z
    try
    tell application theApp to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z = "Annuler")
    end parleFrancais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE jeudi 5 mars 2009 21:41:35)

  • Is there a way to make InCopy open all documents in normal screen mode, always?

    Is there a way to make InCopy open all documents in normal screen mode, always?
    Now it opens in the screen mode the InDesign page is in when checked in. We don't want that.
    Thanks,
    Frederik

    No, there's no way to get rid of it in InCopy.  InCopy opens layouts in the mode the InDesign user saved them, including Normal vs. Preview, Frame edges showing or not, Hidden characters showing or not, and so on.
    You could try asking the designers to switch to Normal view before saving the INDD file.  Or you could assign a keyboard shortcut to the Normal view in InCopy and tell everyone to use that. We're on Macs so we use Control-N for Normal and Control-Shift-N for Preview.
    AM

  • How do I make pages open a template on launch?

    I just switched from Office Mac to pages because I got a retina macbook, and Office looked all blurry.
    Anyway, I made a perfect template for myself and set it to the default, but still when I open pages, it opens the finder window that lets you choose a document. How to I make it open a new document using my template when I launch it?
    Thanks!

    Pages ’09 v4.3 on OS X 10.8.5.
    Pages > Preferences > General : Use template : Choose...
    Pick the Template you want, close Preferences. The next time you launch Pages, it will default to the specified Template.

  • Stale data error: OA page opened by different users

    Hi,
    An OA Page which is basically use to query order details and update certain custom tables based on the order details has been developed.
    The first page which is a search page perfoms the search based on the "Custom Name", "Order Status" --> Bith LOV fields
    When this page is opened by multiple users we get a "Stale Data" error.
    Kindly help to resolve this issue.
    Thanks.

    Hi ,
    Please check root AM that you have created the variable in Custom Properties (RETENTION_LEVEL ,MANAGE_STATE)
    Thanks
    Pratap

  • Can we make some fields mandatory on CAT5 selection screen ???

    Hi Experts,
    Can we make some of the fields mandatory on CAT5 selection screen.
    I want to make posting period as an mandatory field.
    Thanks in advance.
    Regards,

    Use below link :
    http://help.sap.com/saphelpnw2004s/helpdata/en/7d/f63a22015111d396480000e82de14a/frameset.htm_
    Regards
    Ashish

  • Apple TV Menu dimmming in sub menus and user info screens

    Hey all. I have a problem with my apple tv (2nd gen) dimming when in a sub menu or entering usernames, passwords, etc. When I back out to the main menu the screen brightens. The screen is at normal level when watching videos etc.
    I believe it has nothing to do with my lcd since the screen is fine on the main apple tv menu.
    Any ideas? Is this a setting? I didn't see it in the settings menu.

    Welcome to the Apple Community.
    One of my tv's dims its screen when it is mostly black, but this is a function of the tv, could the same be so in your case.

  • Make (LDB)PNP Fields obligatory on selection-screen

    I am using LDB PNP.. I want to make some fields of PNP as obligatory. How Can I do that?
    So far I am doing the following...
    <b>Initialization.
    PNPABKRS-LOW = '?'.
    Append PNPABKRS.
    At selection-screen.
    if PNPABKRS-LOW is initial.
    PNPABKRS-LOW = '?'.
    Message e100(z01).
    endif.</b>
    What you suggest ?
    Thanks
    Message was edited by: Saquib Khan

    You have to do this way,
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'PNPABKRS-LOW '.
          SCREEN-REQUIRED = 1.
          MODIFY SCREEN.
        ENDIF.
    ENDLOOP.

  • Ad pages open on their own and screen is unresponsive.

    I have even erased my iPad and started over.  At times the screen is unresponsive.  Other times, the iPad starts typing on its own, pages flash open and closed. Even pages I've never opened, to my knowledge, start popping up.
    Hardware issues?

    If you erased and restored the iPad, then I would assume that it is a hardware issue. Make an appointment at an. Apple Store and ask them to take a look at your iPad.

  • When is Apple going to make Mainstage available to iPad users ?

    I'm a drummer and music producer, and I would love to see Apple make Mainstage 2 available for the iPad. Why haven't you guys done this yet ?

    These are user-to-user forums and are not monitored by Apple - and nobody here knows what Apple's plans are. If you want to leave feedback for them then you can do so here : http://www.apple.com/feedback/ipad.html

  • When the page opens it fills the whole screen and I cannot access anything else unless I go out of the current site. I cannot minimize it.

    When I open a site, it fills the whole page and I cannot minimize it or get to another page simultaneously. The only option I currently have is to put the cursor in the upper left corner and only the tab for the current site is shown.

    On Mac use Fn + F11 to toggle full screen mode
    *https://support.mozilla.org/kb/how-to-use-full-screen
    You can try to remove the Firefox plist file (org.mozilla.firefox.plist).
    *http://www.macfixit.com/article.php?story=20060606082246983 How .plist files become corrupt and troubleshooting the results
    Go to "~/Library/Preferences" and remove the plist file for Firefox (org.mozilla.firefox.plist)

  • How can I make QT open movies in center of screen?

    I have a 32 inch monitor. When I double click a quicktime movie file, it always opens in the far upper left corner of my screen. Difficult and awkward for viewing. I then have to drag it to the center where it is easier to view. There must be a way to make QT stop defaulting to the upper left, and instead open in the center of the screen. No? Any help, please. Thanks.

    Wouldn't it be a useful option in tools->options->tabs to open new tabs at end? That way people can easily choose whatever their working preference is - mine is "at end" as it keep the tabs I'm going to get around to away from the ones I'm working on right now.
    A check-box would be much simpler for the general user than hitting the "here there be dragons" area with all the potential pitfalls that lurk there.

  • I have a generation 3 Ipad  and it fully died so I put it to charge. It's been flickering on and off between the apple symbol my home page for 2 seconds and the screen going back to black with the loading symbol. What should I do?

    I've tried to factory reset it but it not let me even get that far

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
     Cheers, Tom

  • Where are the scripts that make Flex apps work with the JAWS screen reader?

    From the adobe website:
    To use the JAWS screen reader with a Flex application, users must download scripts from the Adobe accessibility website before invoking a Flex application. Screen readers work best when in Forms mode, which lets users interact directly with the Flex application. These scripts let users switch between Virtual Cursor mode and Forms mode by using the Enter key from almost anywhere within a Flex application. If necessary, users can exit Forms mode by using the standard JAWS keystrokes.
    Users can download these scripts, and the installation instructions, from the Adobe website at www.adobe.com/go/flex_accessibility."
    The link is broken and the marvellously dense chat support person said that Adobe doesn't support Flash Builder.
    Where are these scripts located?

    user8757041 wrote:
    I successfully installed oracle 11gR1 but the network configuration is not complete. can I still connect to the database server from XP? How? I am new in connection, even different OS. I use putty and I can access the command line as root or other users.(after I edit IP address at Network Configuration)
    I installed OEL 5.3 not on virtual drive, but directly to my desktop computer.
    what is connection database software?? is it different from putty?
    where can I get the DMS? ( data mover scripts, am I right?)
    wait for your response..
    regard.I'm afraid, I don't follow you very well. Anyway, if you have a db, with a running listener, you should be able to connect from any client over your local network (even through different OS). In that case, you'll need a client software (i.e. Oracle client runtime installation). Regarding the DMS, you should be able to find it onto the client after Peopletools/Peoplesoft application installation.
    Nicolas.

  • Open Quantity in item selection screen

    I am Stuck in btwn a process. In my Orgn we have ZMO and ZCO Doc types. ZMO is for manf order and ZCO is for Call off order from created with reference to ZMO.1 ZMO= N ZCO
    ZMO - 10 Quantities - Ill have to use the materials , I should create ZCO with ref to the ZMO.
    When I create 1st ZCO for 6 qty and reject all the 6 in the ZCO , then i create 2nd ZCO and i click on the copy with reference and item selection , it is still showing 4 as qty where i can change it to 10 , but i want that to reflect as 10 automatically. Please help
    ZMO- 10
    1st ZCO- 6 VBAP-ABGRU= Yes for all 6
    2nd ZCO- Item selection in copy with reference screen from ZMO is reflecting as 4 where it should reflect as 10.
    Is there any data transfer routine which should be amended ?
    How is the OPEN Quantity calculated in Standard SAP order process

    Hi, Prashanth
    As per my understanding there is no update of quantity in quotation if you reject sales item in sales order.
    only one way is to delete created sales order then quantity of quotation is reset,
    kapil

Maybe you are looking for