Using Applescript to print calendars in MS Outlook

I print my daily in portrait orientation, with the task list.  I like to print my weekly calendar in landscape orientation, without the task list.
I'm new to Applescript and have been poking around in the Outlook library but can't find anything there that indicates how to even just print Calendars using Applescript.
Is there a way to change the page setup to landscape orientation, then print the weekly format (without tasks) and the reset the print orientation to portrait?
Thanks in advance-
Tom
Mac OS 10.6.8

You mention using AS to set the preset. Do you know how to do that?
I'm trying to find out how to use a print preset in Applescript on 10.6.7. The only things I've found on the internet suggest running a terminal command that changes the preset, but they are talking about 10.4 and it doesn't work in 10.6. I can't find the answer to this anywhere. It seems like it should be rather simple.

Similar Messages

  • How to use Applescript to print out a certain calendar at 7am every morning?

    Hey guys,
    I am trying to use AppleScript to print out one of my calendars each day at 7am every morning.
    I have come up with this so far:
    tell application "Calendar"
           view calendar "My Appointments" at (my (current date))
           switch view to day view
           activate
                        tell application "System Events"
                     keystroke "p" using command down
                     delay 1 -- (seconds)
                     tell process "Calendar"
                                                      tell window "Print"
                                                                     if value of checkbox "Calendar Keys" is not 0 then
                                      click checkbox "Calendar Keys"
                               end if
                                                      end tell
                                       end tell
                        end tell
    end tell
    The problem with this is that it will print out whatever calendars are currently viewable. I can't figure out how to tell it to deselect other calendars and just select the one I want. I also want to tell it to print this out at 7am every morning.
    Any help would be very appreciated!

    If you wanted to do the printout over multiple days, you would be best to loop through each day's events in the way the current script does, but to put a new loop around it that gets each new day's data:
    --opens a temporary file
    set fileRef to open for access ((path to desktop) as string) & "meetings.txt" with write permission
    --effectively empties the file
    set eof fileRef to 0
    tell application "Calendar"
              set dayCount to 9 --this will be the number of days to look forward (not including today)
              repeat with currentDay from 0 to dayCount
                        set startList to {}
      --get's today's date
      --set startRange to ((current date) + 12 * days) -- I used this for testing, to point to a day that had many appointments.  I've left it so you can use it, too.
                        set startRange to ((current date) + (currentDay * days))
      --set the start of the range to previous midnight
                        set hours of startRange to 0
                        set minutes of startRange to 0
                        set seconds of startRange to 0
      --set end of the range to next midnight
                        set endRange to (startRange + 1 * days)
      --get today's events
                        set todaysEvents to get (events of calendar "My Appointments" whose (start date is greater than startRange) and (end date is less than endRange))
      --make a new list with start time of the event for sort purposes
                        repeat with theEvent in todaysEvents
                                  set end of startList to {startdate:start date of theEvent, eventID:theEvent}
                        end repeat
      --sort using a bubble sort (suitable for short lists)
                        repeat with i from 1 to (count of startList) - 1
                                  repeat with j from i + 1 to count of startList
                                            if startdate of item j of startList < startdate of item i of startList then
                                                      set temp to item i of startList
                                                      set item i of startList to item j of startList
                                                      set item j of startList to temp
                                            end if
                                  end repeat
                        end repeat
      --empty the original list
                        set todaysEvents to {}
      --repopulate the list in correct chronological order
                        repeat with theEvent in startList
                                  set end of todaysEvents to eventID of theEvent
                        end repeat
      --write today's date to the file
      write (date string of startRange & return & return) to fileRef
      --if there are no events, write this to the file as well
                        if length of todaysEvents is 0 then
                                  write "No events" & return & return to fileRef
                        else
      --process each event into format: hh:mm-hh:mm/new line/event summary
                                  repeat with theEvent in todaysEvents
                                            set startdate to start date of theEvent
                                            set enddate to end date of theEvent
                                            set startHours to hours of startdate as string
                                            if length of startHours is 1 then set startHours to "0" & startHours
                                            set startMins to minutes of startdate as string
                                            if length of startMins is 1 then set startMins to "0" & startMins
                                            set starttime to startHours & ":" & startMins
                                            set endHours to hours of enddate as string
                                            if length of endHours is 1 then set endHours to "0" & endHours
                                            set endMins to minutes of enddate as string
                                            if length of endMins is 1 then set endMins to "0" & endMins
                                            set endTime to endHours & ":" & endMins
      --write the event to the file
                                            set theSummary to (starttime & "-" & endTime & return & summary of theEvent & return & return) as string
      write theSummary to fileRef
                                  end repeat
                        end if
      write return to fileRef
              end repeat
    end tell
    --close the file
    close access fileRef
    --print the file
    set theFile to (((path to desktop) as text) & "meetings.txt") as alias
    tell application "TextEdit"
              print theFile without print dialog
    end tell

  • Using AppleScript to auto-archive mail in Outlook 2011

    I want to use AppleScript to set up a schedule to auto-archive mail greater than X days old. What I've found so far is below, and the error I'm receiving is "error "Microsoft Outlook got an error: Can’t get pop account \"TargetProcess\"." number -1728 from pop account "TargetProcess"".
    # the time we want to archive from
    set theArchiveCutoffTime to ((current date) - (32 * days))
    property theCount : 0
    tell application "System Events"
      set targetProcess to count (every application process whose name is "Mail")
    end tell
    tell application "Microsoft Outlook"
      set thisAccount to pop account "TargetProcess"
      set thisFolders to mail folder of thisAccount
    # find the "Inbox" of topFolder and "Mail ARCHIVE" of on my computer
      repeat with thisFolder in thisFolders
      if name of thisFolder is "Inbox" then
      set theInbox to thisFolder
      else if name of thisFolder is "Mail ARCHIVE" then
      set theARCHIVE to thisFolder
      end if
      end repeat
    # find the archive "Inbox"
      repeat with thisFolder in mail folder of theARCHIVE
      if name of thisFolder is "Inbox" then
      set theArchiveInbox to thisFolder
      end if
      end repeat
      set theArchiveTarget to theArchiveInbox
    # archive the Inbox
      repeat with theMessage in message in theInbox
      if time received of theMessage < theArchiveCutoffTime then
      move theMessage to theArchiveTarget
      set theCount to theCount + 1
      else
      # we get messages from oldest to newest
      exit repeat
      end if
      end repeat
    # archive sub-folders
      repeat with thisSubfolder in mail folder of theInbox
      # find the archive subfolder corresponding to this
      repeat with thisARCHIVEubfolder in mail folder of theArchiveInbox
      if name of thisARCHIVEubfolder is name of thisSubfolder then
      set theArchiveTarget to thisARCHIVEubfolder
      end if
      end repeat
      # archive messages
      repeat with theMessage in message in thisSubfolder
      if time received of theMessage < theArchiveCutoffTime then
      move theMessage to theArchiveTarget
      set theCount to theCount + 1
      else
      # we get messages from oldest to newest
      exit repeat
      end if
      end repeat
      end repeat
    end tell
    I'm working in AppleScript Editor v2.6.1 (152.1), Microsoft Outlook 2011 v14.3.5, OSX 10.9.4 Mavericks.

    Ok, red_menace above me had a shorter and more elegant solution to the question, I'm adding this just for another example.
    To solve your problem I'd make a mail rule that looked for any messages with "Filename:" in them (along with whatever criteria you wanted, like sender, domain, etc). The mail rule would execute the Applescript. My assumption is that the "Filename:foobar" text could be anywhere in the email, not necessarily the first thing in a paragraph, so I had to parse it differently.
    The results end up in a datalist, (theFilename {} ) that you can parse later to collect all filenames found in whatever messages were processed.
    I realize this could be cleaner, hope it's not hard to follow, but I did it really fast. It works flawlessly for me, picking out the name of the file no matter where in the email it appears.
    using terms from application "Mail"
    on perform mail action with messages theSelectedMessages for rule theRule
    repeat with aCounter from 1 to count theSelectedMessages
    set theMessage to item aCounter of theSelectedMessages
    set theContent to content of theMessage
    set theWords to every word of theContent
    set theFilename to {}
    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to ":"
    repeat with thisLoop in theWords
    try
    if (text item 1 of thisLoop) is "Filename" then
    set end of theFilename to (text item 2 of thisLoop)
    -- rest of your logic goes here the display is just to show it finds the filename, take it out!
    display dialog theFilename ¬
    buttons {"OK"}
    end if
    end try
    end repeat
    set AppleScript's text item delimiters to tid
    end repeat
    end perform mail action with messages
    end using terms from
    Message was edited by: stephen.bradley Typos for the win!

  • Using applescript to print from printers other than the default

    Hi
    I have this script to print from Quark which works fine:
    tell application "QuarkXPress"
    tell print setup of document 1
    set separation to false
    set printer type to "HP Laserjet 8150 Series"
    set paper size to "A3"
    set orientation to portrait
    set bleed to "3"
    set page position to center horizontal
    set print spreads to false
    set reduce or enlarge to "100%"
    set registration marks to centered
    set tiling to off
    end tell
    print document 1
    end tell
    It works fine but if I change my default printer to something else eg. our canon colour printer, then the document prints from there instead.
    If anyone can help it would be much appreciated
    Kind Regards
    Andrew

    Thanx Nova Scotian..
    Didnt quite work but i got this from another forum which did in case your interested:
    tell application "Printer Setup Utility"
    set the visible of every window to false
    if printer "ExactPrinterName" exists then set current printer to printer "ExactPrinterName"
    get current printer -- debugging
    if (current printer is not "ExactPrinterName") then display dialog "Please setup your 'ExactPrinterName'!!"
    quit
    end tell
    Of course, ExactPrinterName is the name of the printer you WANT to use as it exists in the Printer Setup list.
    Andrew

  • How to filter Outlook for Mac calendar events by category using AppleScript

    Hi all --
    I'm trying to write an Applescript on OSX to filter Outlook for Mac 2011 calendar events based on event categories, e.g. find all events tagged as "Conference". For example, I have a calendar event named "WWDC" that is found by the following script:
    tell application "Microsoft Outlook"
      set theCategoryConference to first category whose name is "Conference"
      set theConferenceList to every calendar event whose (subject is "WWDC")
      display dialog "There were " & (count of theConferenceList) & " Conferences."
      set theEvent to item 1 of items of theConferenceList
      display dialog "Categories contains conference: " & (categories of theEvent contains {theCategoryConference})
    end tell
    The above finds 1 event, and the final line displays "true" as this event has been tagged with the Conference category.
    However what I really want to do is find all such events. The following fails to match any events:
    set theConferenceList to every calendar event whose categories contains {theCategoryConference}
    ThIs seems to me like it should work, but returns 0 matching events. Is there a different syntax to use, or is this a limitation of Outlook for Mac that perhaps doesn't allow filtering events based on a nested collection (the categories attribute on calendar event objects)?
    Thanks!
    Ramon

    Hello
    I don't have Outlook 2011 but only guess here.
    Generally speaking, AppleScript's "whose" filter is very limited and does not support list containment test. So perhaps you'd have to resort to something like the following script, which actually scans the events for test.
    tell application "Microsoft Outlook"
        my events_with_categories({category "Conference"})
    end tell
    on events_with_categories(cats)
            list cats : list of categories to be matched
            return list : list of calendar events whose categories contain every item of cats
        script o
            property ee : {}
            property cc : {}
            tell application "Microsoft Outlook"
                set ee to calendar events
                repeat with e in my ee
                    set e to e's contents
                    set cc to e's categories
                    set _match to true
                    repeat with c in cats
                        set c to c's contents
                        if c is not in my cc then
                            set _match to false
                            exit repeat
                        end if
                    end repeat
                    if _match then set end of my ee to e
                end repeat
                return my ee's contents
            end tell
        end script
        tell o to run
    end events_with_categories
    Notes.
    * Script is not tested.
    * IF this works but is too slow, we may try to speed it up by retrieving categories of events (list of lists) in one statement, by which we can dramatically reduce the total number of Apple Events to send.
    Good luck,
    H

  • I am using the big date calendar template and when I submit it to apple for printing I lose the name of two months. These names are not text boxes. I see the names when I send it in but something happens during the transmission to apple. It was suggested

    I am using the big date calendar template in iPhoto. I am on Lion 10.7.2, macbook air. The names of the months are on each calendar page but something happens when I send the data to Apple. The names are part of the template. They are not text boxes. I lose two names on the calendar after it is sent to Apple. Apple suggested I make a pdf file of my calendar before sending it in and check to make sure every name shows. I did this with a calendar I just sent in. The calendar was correct. All names of the months were showing. After sending the data two month names disappeard because when it arrived by mail, it was incorrect. Apple looked at my calendar via a pdf file and it was incorrect.  This is second time this has happened. I called Apple and they had me delete several folders in the Library folder, some preferences and do a complete reinstall of iPhoto.  I have not yet remade the defective calendar. I am wondering if anyone else has had this problem?
    kathy

    Control-click on the background of the view all pages window and select "Preview Calendar" from the contextual menu.
    You can also save the pdf as a file to compare to the printed calendar.  If the two names are visible in the pdf file then the printed copy should show them.  Contact Apple for a refund.  Apple Print Products - Apple Store (U.S.)

  • I use a Win7 PC with iCloud and Outlook 2010 for syncing my calendar and contacts. I can enter data in my Outlook Calendar and it will appear in iCloud, but data entered in iCloud does not sync back to Outlook.  ICloud syncs to my iphone fine both ways.

    I use Win 7 PC with iCloud and Outlook 2010 for syncing my Contacts and Calendar.  They have stopped syncing...mostly.
    Now, appointments I enter on my local Outlook (iCloud) Calendar goes up to iCloud fine.  But, data I enter on iCloud directly does not come down to my local Outlook iCloud Calendar.  If I reboot the computer, the iCloud data shows up.
    Also, Contacts I try to enter on my Outlook (iCloud) Contacts goes up to iCloud fine, but does not show up in my local iCloud Contacts.
    All syncing works with my iPhone.
    I have signed out of iCloud on PC.  I have stopped syncing and re-started.  No change.
    I have an .aplzod folder for iCloud.  I have a separate Earthlink.net.pst email account in Outlook and a me.com.pst Outlook email account (which I don't actually use) listed under Data Files.
    Any help would be appreciated.  Curious that Outlook will upload to iCloud but not receive downloads unless I reboot.  However, rebooting does not download the missing Contacts.
    Jim Robbins

    Hi Jim!
    You've started off with some good troubleshooting steps, so let's see if we can take this a little further and figure out what the issue is with your iCloud contacts and calendars. I have two articles here that will help you troubleshoot this issue a little further, but the troubleshooting steps for both articles are exactly the same, so I will lay those out for you here:
    Note: When using iCloud Control Panel 2.0 and later, iCloud Calendar event descriptions in Outlook 2010 do not support text formatting (bold, italics, or underline), HTML, images, or attachments. The contextual (right-click) menu has also been disabled.
    If you are having trouble with a PC (with Outlook 2007 or 2010) and iCloud Calendar, try each of these steps, testing after each to see if the issue is resolved:
    Verify that you are using a Windows configuration that is supported by iCloud. For more information, see iCloud system requirements.
    When enabling Calendars in the iCloud Control Panel, part of the setup process is to copy your Calendars data from the default Outlook ".pst" file to iCloud, and then remove the Calendars from the ".pst" file by placing them in the Deleted Items folder in Outlook. The Calendars data is then stored in the iCloud data set within Outlook so that changes can be pushed to and from Outlook by iCloud. Be sure you are looking for your data within the iCloud dataset within Outlook after enabling Calendars in the iCloud Control Panel. The deleted files can be seen by viewing Deleted Items within your Outlook Folder List. This is not iCloud removing your data; iCloud simply copies your data into the iCloud data set and then removes the local Calendars data by placing it in the Deleted Items folder.
    Make sure your computer is online. Attempt to view www.apple.com and iCloud.com. If you can't connect to the Internet, your iCloud calendars and events will not update in Outlook. Click here for more information about troubleshooting your Internet connection.
    Open a secure website to test if you are online as is necessary for iCloud Calendar. This also tests if the ports 80 and 443 are accessible. Outlook requires port 443 access to iCloud in order to push and pull updates to and from the iCloud Calendar servers.
    Verify that your iCloud member name is entered into the iCloud Control Panel pane. See iCloud Setup for more information about setting up iCloud on Windows.
    Completely close and reopen the iCloud Control Panel.
    If you recently made changes in Outlook and they are not moving to your other devices or vice-versa, click the Refresh button in Outlook.
    Turn iCloud Calendar off and back on:
    Close Outlook.
    Open the Windows Control Panel:
    In Windows 8, move the pointer to the upper-right corner of the screen to show the Charms bar, click the Search charm, and then click the iCloud Control Panel on the left.
    In Windows 7 and Vista, choose Start menu > All Programs > iCloud > iCloud.
    Remove the checkmark in the checkbox next to Mail, Contacts, Calendars & Tasks, and click Apply. Wait a few seconds, then replace the checkmark, and click Apply.
    Open Outlook and test to see if the issue has been resolved.
    Ensure the iCloud Outlook Add-in is active within Outlook.
    Outlook 2010:
    Open Outlook 2010.
    Click the File menu.
    Click Options in the left panel of the Outlook window.
    Click Add-Ins in the left panel of the Outlook Options window.
    Look at the list of add-ins beneath "Active Application Add-Ins" and verify that the "iCloud Outlook Add-in" is listed.
    For Outlook 2007, follow these steps to verify the iCloud Outlook Add-in is active
    Open Outlook 2007.
    From the Tools menu, choose Trust Center.
    Select Add-ins from the left column.
    Look at the list of add-ins beneath "Active Application Add-Ins" and verify that the "iCloud Outlook Add-in" is listed.
    For additional information about managing Add-ins with Microsoft Outlook, see this Microsoft support document.
    Restart your computer. This may sound simple, but it does reinitialize your network and application settings and can frequently resolve issues.
    iCloud: Troubleshooting iCloud Contacts
    http://support.apple.com/kb/ts3998
    iCloud: Troubleshooting iCloud Calendar
    http://support.apple.com/kb/ts3999
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • I use Windows Vista and Microsoft Outlook. After migrating to iCloud, the calendar of iCloud tranferred only part of my past Calendar items to the folder iCloud Calendar in my Outlook. How can I transfer all the entries?

    I use Windows Vista and Microsoft Outlook. After migrating to iCloud, the calendar of iCloud tranferred only part of my past Calendar items to the folder iCloud Calendar in my Outlook. How can I transfer all the entries? In iCloud's site all are there.

    If the calendar is on iCoud.com, all you would need to do to get it on your phone is go to Settings>iCloud on your phone, sign into your iCoud account and turn Calendars on.  The iCloud calendars will then download to your phone.

  • ICal and subscribed calendars with MobileMe using AppleScript

    I am having the same problem as many of you; I have a MobileMe account which does not sync the calendars I have in iCal that are subscriptions. I found this great script online which I'll post below. I don't know anything about AppleScript so I'm just copy-pasting. I want it to work, but I'm getting the error "The variable theOldEvent is not defined." right around the line "if similar_found is true then set theOldSummary to the summary of theOldEvent" kinda near the middle. Like I said, I don't know anything about AppleScript. So my question is; how can I fix this error and/or is there some better way of using AppleScript/Automator to do this same thing? Thanks!
    Script to duplicate Calendar orgCalendar into target dupCalendar
    E.H. 12.9.2008
    property myCopies : 0
    property myUpdates : 0
    property myObsoletes : 0
    property orgCalendar : "Sekretariat"
    property dupCalendar : "Sekretariat copy"
    property dupEvents : {}
    property myDeletes : {}
    set myCopies to 0
    set myUpdates to 0
    set myObsoletes to 0
    set dupEvents to {}
    tell application "iCal"
    -- set theCalendars to every calendar
    set theCalendarNames to title of every calendar
    set theOrgCalendar to a reference to calendar orgCalendar
    if theCalendarNames contains dupCalendar then
    set theCalendar to a reference to calendar dupCalendar
    else
    set theCalendar to make new calendar with properties {title:dupCalendar}
    --set theCalendar to make new calendar with properties {title:dupCalendar, color:"{65535, 0, 0}"}
    end if
    set the eventList to uid of every event of theOrgCalendar as list
    set the eventCount to the count of the eventList
    repeat with theUId in eventList
    tell theOrgCalendar
    set theEvent to (the first event whose uid is theUId)
    -- set theProperties to the properties of theEvent as record
    set theDate to the start date of theEvent
    set theSummary to the summary of theEvent
    set theStampDate to the stamp date of theEvent
    end tell
    tell theCalendar
    try
    set theOldEvent to (the first event of theCalendar whose (start date) is theDate as date)
    set similar_found to true
    on error
    set similar_found to false
    set theEndDate to the end date of theEvent
    set theAllDay to the allday event of theEvent
    set theLocation to the location of theEvent
    -- Funny construction to work araund the fact that location may be missing a value
    try
    if theLocation is equal to "" then
    end if
    on error
    set theLocation to ""
    end try
    set theDescription to the description of theEvent
    try
    if theDescription is equal to "" then
    end if
    on error
    set theDescription to ""
    end try
    if theAllDay is true then -- work around a funny bug with all day events
    set theDate to (theDate as date) + 2 * hours
    set theEndDate to (theEndDate as date) + 2 * hours
    end if
    set newEvent to make new event at end with properties {summary:theSummary, location:theLocation, start date:theDate, end date:theEndDate, allday event:theAllDay, description:theDescription}
    -- make new event at end with properties theProperties
    set the end of dupEvents to (the uid of newEvent)
    set myCopies to (myCopies + 1)
    end try
    end tell
    set second_necessary to false
    if similar_found is true then
    set theOldSummary to the summary of theOldEvent
    if theSummary is not equal to theOldSummary then
    --is there a different one?
    try
    set theOldEvent1 to (the second event of theCalendar whose (start date) is theDate as date)
    set theOldSummary to the summary of theOldEvent1
    if theSummary is equal to theOldSummary then
    set theOldEvent to theOldEvent1
    set the end of dupEvents to (the uid of theOldEvent)
    else
    -- cycle repeat ?
    end if
    on error
    -- beep
    try
    set theEvent1 to (the second event of theOrgCalendar whose (start date) is theDate as date)
    set second_necessary to true
    on error
    set the end of dupEvents to (the uid of theOldEvent)
    end try
    end try
    else
    set the end of dupEvents to (the uid of theOldEvent)
    end if
    if second_necessary is true then
    set theEndDate to the end date of theEvent
    tell theCalendar
    set theOldEvent to make new event at end with properties {summary:theSummary, start date:theDate, end date:theEndDate}
    end tell
    set the end of dupEvents to (the uid of theOldEvent)
    end if
    set theOldStampDate to the stamp date of theOldEvent
    if theStampDate is greater than theOldStampDate then
    -- update the event
    set summary of theOldEvent to theSummary -- capitalization may have changed
    set theAllDay to the allday event of theEvent
    set allday event of theOldEvent to theAllDay
    set theEndDate to the end date of theEvent
    if theAllDay is true then -- work around a funny bug with all day events
    set theEndDate to (theEndDate as date) + 2 * hours
    end if
    set end date of theOldEvent to theEndDate
    set theDescription to the description of theEvent
    try
    if theDescription is equal to "" then
    end if
    on error
    set theDescription to ""
    end try
    set description of theOldEvent to theDescription
    set myUpdates to myUpdates + 1
    end if
    end if
    end repeat
    end tell
    -- Delete obsolete events
    set myObsoletes to 0
    set myDeletes to {}
    tell application "iCal"
    set myUIDs to uid of events of theCalendar
    end tell
    repeat with myUID in myUIDs
    if dupEvents does not contain myUID then
    set the end of myDeletes to myUID
    set myObsoletes to (myObsoletes + 1)
    end if
    end repeat
    tell application "iCal"
    repeat with myDel in myDeletes
    delete (every event of theCalendar whose uid is myDel)
    end repeat
    end tell
    -- delete duplicates
    set myDeletes to {}
    tell application "iCal"
    set myStarts to start date of events of theCalendar
    set mySummaries to summary of events of theCalendar
    set myUIDs to uid of events of theCalendar
    set myLength to length of myUIDs
    end tell
    repeat with i from 1 to (myLength - 1)
    set thisStart to (item i of myStarts)
    set thisSumm to (item i of mySummaries)
    repeat with j from (i + 1) to myLength
    set thatStart to (item j of myStarts)
    set thatSumm to (item j of mySummaries)
    if thisSumm is equal to thatSumm and thisStart is equal to thatStart then
    set the end of myDeletes to (item j of myUIDs)
    exit repeat
    end if
    end repeat
    end repeat
    set n to count of myDeletes
    tell application "iCal"
    repeat with myDel in myDeletes
    delete (every event of theCalendar whose uid is myDel)
    end repeat
    -- set the visible of calendar theCalendar to false
    end tell
    display dialog (myCopies & " records duplicated, " & myUpdates & " records updated and " & myObsoletes & " obsolete ones deleted") as text

    No longer an issue.

  • Printing from Photoshop using AppleScript

    I am working on a project that will automatically print an image that is moved to a folder.
    Right now, I have the following working: the image from my camera saves to a folder on my desktop, then applescript opens the image in Photoshop and runs an action on it that resizes it, crops it, and then re-saves it into a different folder. Here's where my problem starts...
    My printer - an Epson R800 - does not have a default paper size of 5x7 borderless. That selection has to be made in Photoshop, however, Photoshop actions will not capture paper settings. (Which I think is sooooo stupid, but that's another issue.)
    When the image is dropped in the second folder, it currently automatically prints, but on "letter" size paper.
    I need to script the following:
    Tell Photoshop CS4 to open the image (well, I can do that), but then select the correct paper size (5x7 borderless), and print. I've tried a few different things and they aren't working.
    Any help would be appreciated!
    Thanks,
    Michelle

    Here is a starter that is working just fine at work where I have access to CS2 and printers…
    -- A path to an image file as text
    set PrintImage to (path to desktop as text) & "HE2015.tif"
    tell application "Adobe InDesign CS2"
    activate
    -- Turn off the app dialogs
    tell script preferences
    set user interaction level to never interact
    end tell
    -- Get the new document preset
    set DocPreset to document preset "A4-P" -- Change here
    -- Make our new doc
    set PrintDoc to make new document at beginning ¬
    with properties {document preset:DocPreset}
    -- Get the printer preset
    set PrintPreset to printer preset "Xerox A3-P-SEF" -- Ditto Here
    tell PrintDoc
    set DocWidth to page width of DocPreset
    set DocHeight to page height of DocPreset
    -- Add a rectangle to hold the image
    set ImageFrame to make new rectangle at beginning ¬
    with properties {geometric bounds:{0, 0, DocHeight, DocWidth}}
    tell ImageFrame
    -- Put our image in the rectangle
    place PrintImage as alias
    -- Fit our image to fill box keeping proportions
    tell image 1
    fit given fill proportionally
    fit given center content
    end tell
    end tell
    print using PrintPreset without print dialog
    end tell
    end tell
    There are two strings that you will need to change one for a 'new document preset' and the second for a 'print preset'…
    The example just uses an image off my desktop to test with… Any problems post in the Indesign forum as this no longer belongs here…

  • Setting options in "Printer" section using Applescript InDesign CS

    How can i set define supplementary options found in the "Printer" section of the InDesign dialog box in a print preset using Applescript?
    I would like my script to set duplex option with the proper binding, according to the page orientation.
    When creating print presets manually, these extra options are stored in the print preset, but I can't find how to access them thru Applescript.
    Thanks,
    Peter

    Shane,
    Thanks for your reply, but it is not yet clear to me.
    I know you can set some print properties in the Apple Print event, such as copies, collating, target printer ...but how can I adress the printer-specific options, such as duplex printing? Could you give me a sample line of code?
    And next step, how can I include this "Apple -print" setting in an InDesign Print preset using Applescript? I suppose I have to set the apple printer prefs before creating the InDesign preset. Right?
    Thanks in advance,
    Peter

  • How to gather Calendar events using applescript?

    How do you gather any events schedualed for that day on calendar by using applescript?

    I have got it working with this script.
    If iTunes Pop-up a message, I press a key on my remote control and the Pop-up message / Box disappears.
    tell application "System Events"
    tell process "iTunes"
    -- get the front window's name
    -- get the name of the front window
    set whichWindow to (get the name of the front window)
    -- Ergebnis: "Getting Playlist"
    -- display dialog result
    -- display dialog whichWindow
    -- Ergebnis: {button returned:"OK"}
    set whichButton to (get the name of the front window's button)
    -- Ergebnis: {"Stop"}
    tell whichButton of window whichWindow to key code 53
    -- set the contents of the button to key code 53
    end tell
    end tell
    In a terminal I have typed in "while true; do ./diut.app; sleep 2; done" to see what happend, if iTunes is front most and an iTunes message Pop-up.
    Solved by myself.

  • Why does the iCloud Control Panel say "Install Outlook to use Mail, Contacts, and Calendars?"

    I've just successfully installed the iCloud Control Panel on my PC (runs with Vista). Why does the iCloud Control Panel say "Install Outlook to use Mail, Contacts, and Calendars?" The Bookmarks (with Safari) and Photo Stream options are active, but the Mail (with Outlook), Contacts (with Outlook),and Calendars and Tasks (with Outlook) are not. I'm using Office Outlook 2007. I used to be able to synch my iPhone with my PC's Outlook through iTunes without any problems. Any help would be appreciated.

    I meant to say when in the control panel!

  • Cannot print .pdf attachments in Outlook 2010 on local usb printer using the lastest Adobe Reader

    We can't print pdf attachments from Outlook 2010 on a users local printer via usb with the latest Adobe Reader but it can print to a network copier. We can print from the local printer emails, webpages, regular pdf's on the hard drive.
    Please advise and thanks.

    What is the behavior that you are seeing? Are you getting some error or is it simply failing to print with Reader 10.1.2.
    casper milktoast wrote:
    Update 2-7-12
    When doing a quick print with a right click on the pdf attachment, it will print.
    Also, please let me know that if a simple Right Click > Print operation is working, then what exactly is the operation that is failing.

  • Print calendar in SharePoint 2013

    Hi,
    I am trying to create print option for the calendar day view.I used the below code to show the print preview.
    <input onclick="javascript:void(printwebpart('WebPartWPQ2'))" type="button" value="Print Web Part 2"/>
    <script type="text/javascript">
    function printwebpart(webpartid)
    var WebPartElementID = webpartid;
    alert("ID="+WebPartElementID);
    var bolWebPartFound = false;
    if (document.getElementById != null)
    //Create html to print in new window
    var PrintingHTML = '\n\n';
    //Take data from Head Tag
    if (document.getElementsByTagName != null)
    var HeadData= document.getElementsByTagName("HEAD");
    if (HeadData.length > 0)
    PrintingHTML += HeadData[0].innerHTML;
    PrintingHTML += '\n\n\n';
    var WebPartData = document.getElementById(WebPartElementID);
    if (WebPartData != null)
    PrintingHTML += WebPartData.innerHTML;
    bolWebPartFound = true;
    else
    { bolWebPartFound = false; alert ('Cannot Find Web Part'); } } PrintingHTML += '\n\n';
    //Open new window to print
    if (bolWebPartFound)
    var PrintingWindow = window.open("","PrintWebPart", "toolbar,width=800,height=600,scrollbars,resizable,menubar");
    PrintingWindow.document.open(); PrintingWindow.document.write(PrintingHTML);
    // Open Print Window
    PrintingWindow.print(); }
    </script>By clicking the print button,I am getting the print window.But in print preview dialogue,events are not showing in the right place.below screenshot shows the difference in showing the events.Before print
    print preview
    Please help.
    Thank you.

    Hi,
    According to your post, my understanding is that you want to be able to print the Day view of a Calendar List in SharePoint 2013.
    I also test the code above in my environment, and the result is the same as yours.
    In the print preview dialogue, the events are not showing in the right place as they are in the Calendar list’s Day view.
    As a workaround, I recommend that you can try to follow the steps as below to import the Calendar List into the Outlook 2013 and print the same format as Outlook calendars.
      1.  Open this Calendar List in your site, click on the “Connect to Outlook” under the “Calendar” tab.
      2.  Click “Allow” to confirm that you want to allow the SharePoint website to open Outlook on your computer. Outlook automatically opens.
      3.  Click “Yes” to confirm that you want the SharePoint calendar to connect to Outlook. The SharePoint Calendar automatically appears in Outlook under “Other Calendars”.
      4.  Click “Other Calendars” in the navigation pane in the left side of the window. Click the SharePoint Calendar to open it.
      5.  Go to the “File” tab, click “Print”, select “Daily Style” under the “Settings” to print the Day view of this SharePoint Calendar.
      6.  Click “Print Options”, select the specific “Page range” and “Print range” based on your need, click “Print” after selecting your options to print the SharePoint Calendar.
    For more information, you can refer to:
    http://sprickyrick.blogspot.com/2013/01/print-calendar-andor-lists.html
    http://sharepoint.stackexchange.com/questions/103251/how-to-print-sharepoint-2013-calendars
    Best Regards,
    Yumi Fu

Maybe you are looking for