Applescript and iCal

Hi,
I'm new to Applescript and have a litte problem with iCal. In my script I want to get a list of all summaries of a iCal calendar. But for some reasons I want to set all events to a variable first and get the summary of all events from this variable (and not directly from iCal). I tried it in this way:
tell application "Calendar"
          set sumList to summary of events of calendar "Sync"   -- works fine, result is a list of all summaries
          set calList to events of calendar "Sync"                         -- works fine, result is a list of claendar events
          set sumList1 to get summary of every item of calList -- doesn't work (error 1728)
end tell
Any ideas why the 3rd line doesn't work?

You can get more than one property at a time (in the same loop).  For example, the following, will give you a list of lists (with a sublist for each event which contains the summary, start date, end date, uid).  However, if you explain what you are trying to do, there may be a better way.
tell application "Calendar"
          set calList to events of calendar "XX"
          set propList to {}
          repeat with calEvent in calList
      copy {summary, start date, end date, uid} of calEvent to end of propList
  end repeat
end tell
propList

Similar Messages

  • Address Book and iCal Server backups

    I'm working to implement a company-wide Address Book, iCal, and iChat server via Lion Server where I work, and I've gotten most of the setup figured out (I think), and am approaching the point where I can roll it out to a few users for further testing.  However, before I'm allowed to move forward any further w/ it I have to have two means of backing up in place and ready to be rolled out at the same time as the server—so I'm planning on using Time Machine as one so it does the entirety of the server and its data/settings, but they also want me to do one of the Address Book Server and iCal Server databases individually, like back up the folder the data is, so we can, if ever necessary, import the backup databases to another computer, so we at least have the content, if not the full server functionality.  And, for obvious reasons, it can't be backed up locally. 
    So I'm looking for a means of doing this and would love any input anyone has.  Ease of use/setup is pretty important as this is my first time setting Server up and I've no programming knowledge.  I'm fairly sure I'll be able to find (or write my own, though that's unlikely) or modify and AppleScript that simply copies/duplicates a Finder item, and I know I can have iCal automatically run a script (so I'd just have it run every night at midnight or something), but I have yet to figure out how to get the script to copy the folder to a specified location on a different server (or, for that matter, if it's even possible, though I'm sure it is...right?).  But that's not what I'm trying to ask here...though I certainly wouldn't mind if someone had thoughts on it and wanted to share them !  I just really would like to know which folders to back up, since it's not simply making an archive of the local Address Book.app database.
    And, since I'm already here writing a post, I'll ask one other question that's been nagging at me: in Server Admin.app, with the server (not the services) selected in the sidebar on the left, the Access pane selected in the primary Server Admin window, and Services selected, and trying to dictate which users/groups can access which services, the user can click the "+" in the lower-left corner of the window where added users would appear, and another window pops up next to the Server Admin window that shows a list of the users (and groups if you click the appropriate button).  My question is, why does it show me _krb_anonymous, _krb_changepw, and a total of 81 other items?  I understand more or less what they are (in a very general sense), but why are they shown as users?  More importantly, do they have to be listed there?  Technically I'm probably the only one that's going to be the administrator, and I'll know not to add them or modify them, but I don't want anything related to those items appearing in a directory search in Address Book when I get it set up (as they are showing up now; for instance, one user I created is Sandy, and I have it set to include directory contacts in searches, so on a client machine that is correctly communicating w/ the server (add a user, it appears in a minute on another client machine, and vice versa) if I go to search for that name as soon as I type "s" Sandy, the actual user shows up, but so do five or six other things, all of which are items from the aforementioned list in Server Admin (pretty much anything that has an "s" in it, which of course makes sense)—and that's what I don't want, I don't want the users to search for someone, see something like _krb_anonymous pop up, then think something is screwed up and call me and demand I come fix their computer!).
    Any thoughts, suggestions, and such are more than welcome and much appreciated!
    Thank you to all...

    See the following:
    Folders You Can Move to Your new Mac
    From the Home folder copy the contents of Documents, Movies, Music, Pictures, and Sites.
    In your /Home/Library/ folder:
    /Home/Library/Application Support/AddressBook (copy the whole folder)
    /Home/Library/Application Support/iCal (copy the whole folder)
    Also in /Home/Library/Application Support (copy whatever else you need including folders for any third-party applications)
    /Home/Library/Keychains (copy the whole folder)
    /Home/Library/Mail (copy the whole folder)
    /Home/Library/Preferences/ (copy the whole folder)
    /Home /Library/iTunes (copy the whole folder)
    /Home /Library/Safari (copy the whole folder)
    /Home /Library/Calendars (copy the whole folder)
    If you want cookies:
    /Home/Library/Cookies/Cookies.plist
    /Home/Library/Application Support/WebFoundation/HTTPCookies.plist
    For Entourage users:
    Entourage is in /Home/Documents/Microsoft User Data
    Also in /Home/Library/Preferences/Microsoft
    For FireFox:
    /Home/Library/Applications Support/FireFox
    /Home/Library/Preferences/org.mozilla.firefox.plist
    Credit goes Macjack for this information.

  • Time and iCal

    I am building an applescript to place some events in my calendar every week. The finished product will not place the event on every day according to the results of filtering the calendar for other events in that week. I am stuck on the placement procedure because the script seems to be working as I intended ( when you read the log ), but the events are all getting piled up in iCal on the day the script runs. Any ideas? Here are the script and the log:
    Script:
    tell application "iCal"
    set myCalendar to "Home"
    set today to current date
    tell calendar myCalendar
    make new todo at end of todos with properties {due date:(today + (7 * days)), summary:"My Todo"}
    set n to 7
    repeat while n > 0
    set todaystime to (time of today) as integer
    set starttime to (today + (n * days)) - todaystime + (17 * hours)
    set endtime to (today + (n * days)) - todaystime + (17 * hours) + (15 * minutes)
    make new event at end of events with properties ¬
    {startdate:starttime, enddate:endtime, summary:"My Event"}
    set n to n - 1
    end repeat
    end tell
    (*view calendar myCalendar at today*)
    end tell
    Log:
    tell application "iCal"
    current date
    make new todo at end of every todo of calendar "Home" with properties {due date:date "Tuesday, September 12, 2006 5:15:06 PM", summary:"My Todo"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Tuesday, September 12, 2006 5:00:00 PM", enddate:date "Tuesday, September 12, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Monday, September 11, 2006 5:00:00 PM", enddate:date "Monday, September 11, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Sunday, September 10, 2006 5:00:00 PM", enddate:date "Sunday, September 10, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Saturday, September 9, 2006 5:00:00 PM", enddate:date "Saturday, September 9, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Friday, September 8, 2006 5:00:00 PM", enddate:date "Friday, September 8, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Thursday, September 7, 2006 5:00:00 PM", enddate:date "Thursday, September 7, 2006 5:15:00 PM"}
    make new event at end of every event of calendar "Home" with properties {summary:"My Event", startdate:date "Wednesday, September 6, 2006 5:00:00 PM", enddate:date "Wednesday, September 6, 2006 5:15:00 PM"}
    end tell
    As you can see the in the log, the script is doing what I wanted it to, going forward a week and placing events on all the days coming back to the day before the current day. Is there something I am missing? Or could this be a bug in the communication between the script and iCal?
    Thanks in avance for any help
    Macbook Pro   Mac OS X (10.4.7)  

    Hi,
    Isn't it the property for 'event' 'start date' with the space between start and date. I don't know if they changed this in Tiger, but you might want to check out the dictionary for iCal again.
    gl,

  • AppleScript and Recurring Events

    I'm trying to create an AppleScript that will, essentially, e-mail every event for the week to Remember The Milk so that, on the iPhone, I can pull up Appigo's To Do and get an overview of everything I have to do for the day-- both RTM tasks and iCal events. For all non-recurring events, I'm in great shape.
    The problem, of course, is the way iCal handles recurring events and start dates. Because it considers the start date to be only the first occurrence of a recurring event, they're excluded when start dates are used to get only those events that occur within a specific timeframe.
    I can get all of my recurring events rather easily (although if anyone knows of better way than +...whose recurrence is not ""+ I'd be in your debt), but I don't want to sync every instance of the event. When regular appointments are canceled/rescheduled, I don't want to have to change them in multiple locations.
    Is there a way to get AppleScript to work with only a single occurrence of a recurring event? (Or, preferably, several single occurrences, considering that I've got anywhere between ten and thirty recurring events, depending on the week.)
    I had the thought of, before syncing every week, deleting any previous occurrence of a recurring event, but the script prompts me for the number of days I want to sync each time it runs, and I can foresee wanting to sync two or three weeks at a time, in which case simply deleting the event doesn't really solve the problem anyway.
    null

    Several lines of the “broken” script seem to be badly written, for example:
        set root_Folder to rootFolder as alias -- rootFolder instead of root_Folder
        set events_Folder to events_Foler as alias -- Foler instead of Folder
    Message was edited by: Pierre L.

  • Can I sync my iPhone calendar with exchange server AND ical on my mac ?

    I have been happily using my iPhone synced with my Macbook over usb via iTunes.
    I have contacts and iCal syncing. I have a number of 'calendars' set up in iCal which allow me to view separate aspects of home and work but they all exist within iCal. iPhone just treats these as colour coded appointments (different colour for each ical calendar)
    I really like this set up.
    However, I just changed jobs to a firm where they have a hosted outlook exchange set up and I need to use the exchange calendar for work appointments and showing my availability.
    I have managed to setup my iPhone to work with the Exchange server for email as well as in apple Mail on my mac. This has all worked fine. However, I hesitated when iPhone asked if i wanted to sync my contacts and calendar. I said no as I was unsure if my private calendar/contacts would be uploaded to the public work area.
    In fact it seems that this is the least of my worries:
    As I have read on apple support for iPhone:
    "Note that after configuring an Exchange ActiveSync account, all existing contact and calendar information on the iPhone or iPod touch is overwritten. Additionally, iTunes no longer syncs contacts and calendars with your desktop computer. You can still sync your iPhone or iPod touch wirelessly with MobileMe services."
    So I am really pleased that I didn't let it sync those and wipe out my personal data if that is really true.
    But now I am unsure how best to enable myself to view and update the work calendar on exchange.
    Also it would be nice to see work contacts on my iPhone.
    Contacts
    - although i have said no to sync contacts with Exchange in fact it looks like I can get contacts ok - when i send email from the Exchange account on the phone , it searches Exchange contacts on the server as i type in the TO box.
    - also in Contacts on the iPhone I have a new group that has been created with the name of my Exchange account. The group appears to be blank when you go into it on the phone, but you can type in the search box and get contact details from the server just fine.
    This seems workable for now for my purposes, although updating contacts is not going to be possible that way.
    I'd like more info on that if poss but more importantly..
    Calendar
    - Unlike Contacts, no Calendar has been auto created for Exchange
    - Unlike contacts, I can't see how I can view or search or create an appointment in my Exchange calendar on the iPhone
    What is the best solution to this problem - I presume lots of people face the same dilemma. My initial research suggests that there are multiple ways round this but all of them look like workarounds with various disavantages.
    Questions are
    - Can't I just set up Exchange as one of my calendars in ical?
    - Is it really true that I have to choose between syncing Exchange with work server OR syncing iCal with personal Macbook?
    - What is the best work around for this?
    At the moment I am seriously considering getting a separate iPhone for work and have that sync with Exchange fully although that seems a bit drastic and does not solve the problem of seeing work and home appointments on the same calendar.

    Can't I just set up Exchange as one of my calendars in ical?
    Only if you're running Snow Leopard and your employer will allow access (different than iPhone/mobile device access, so most likely not), but not needed - keep reading.
    Is it really true that I have to choose between syncing Exchange with work server OR syncing iCal with personal Macbook?
    No. It was true, but with the v3.0 software that changed - you can now sync your Exchange contacts and calendar over the air, and your Address Book and iCal via iTunes over the docking cable.
    What is the best work around for this?
    None needed. When you set up the exchange account, and choose to turn on syncing of contacts and calendars, you will be prompted to remove all other data, or keep it on the iPhone. Choose the keep option. Note that in that case, your personal data will not be uploaded to the Exchange server - the iPhone keeps them separate (although you can choose to view them in a merged fashion).
    I have this set up on my phone (Exchange calendar along side personal and other calendars from iCal). Same for contacts. Works great.

  • Need help with applescript and Xcode 4.3.2

    I'm trying to write my first application that will involve a GUI. I can code applescript using script editor with a bit of effort, but I'm want to have users input more than one piece of information in the pop up. So, I download xcode, create my first applescript cocoa project go to MainMenu.xib and add a bunch of labels, text fields and buttons. Looks fairly nice... Go to start it and... nothing (well the window pops up, but it doesn't do anything). Unfortunately, I haven't figured out how to link the window to the applescript... So, how do I...
    * Have the applescript prepopulate data in the text fields and pulldowns
    * Once the user changes the data in the fields tell the applescript
    * Tell the window to close and pass the control back to the applescript once either the cancel or submit button is pressed.
    More detailed...
    * What's an outlet and how do I use it here? Which of the 18 outlet(s) do i use for this?
    * What's a property (referenced on one of the web pages I saw around applescript and cocoa) and do I need them here?
    Looking at the documentation with xcode, there isn't a lot about xcode and applescipt. Looking at the web, the top links are a few years old. So, links to good relevent documentation would be very nice as well as direct answers to the questions
    Thanks,
    Scott

    I'm not sure why you are closing it, but the NSApplication class is what keeps track of the windows.  If you don't want to connect the window to an outlet from the interface editor, you can use something like
    set theWindow to current application's NSApplication's sharedApplication's mainWindow()
    ...and from there you can use whatever NSWindow methods, for example
    theWindow's performClose_(me)

  • Problems with Repeating Events on Palm and iCal

    Hi,
    I'm having a problem with daily-repeating events entered into either my Palm or iCal. When I put events in my palm and sync them to iCal, the iCal calendars look right, but then the Palm events become truncated,i.e. only the first day of daily event will be visible. If I do nothing but just sync again, the events in iCal become weirdly duplicated, i.e. if an event had two repeats, the "original" occurrance will be there, along with a second, starting on next day of the series, lasting for the same number of repeats. Is there any way to make one calendar the overwriting calendar while using iSync? Or do you know of some other fix? This problem doesn't seem to affect other repeating events, either monthly or yearly.
    Thanks
    20" iMac with Intel   Mac OS X (10.4.10)   500 GB HD, 2GB RAM 60GB Video iPod

    As I just posted in another thread, there are a whole series of 'representation disconnects' between the Palm calendaring application and iCal.
    While this article— iSync: About Syncing Recurrent Events Between iCal and Palm OS Based Devices—would lead to you believe that iSync is primarily the issue, it's not: this behavior occurs primarily because of the differences between the calendaring programs in each environment, and only secondarily because of the manner in which records are pushed and pulled by the synchronization framework.
    iSync itself is simply another compliant sync client, and there is unfortunately no workaround for the issues delineated in the article.

  • How to sync iphone 5 and ical?

    how to sync iphone 5 and ical?

    MacBook Pro
    https://discussions.apple.com/community/notebooks/macbook_pro
    http://www.apple.com/support/macbookpro
    http://www.apple.com/support/ical
    http://www.apple.com/support/iphone

  • How to get rid of automatically created Mail and iCal accounts on client?

    I have recently setup an OS X 10.6 Server for our small office. I got the domain name wrong in the initial install and fixed this by doing a complete clean reinstall of OS X 10.6 server (now upgraded to 10.6.4).
    The problem is that one of the OS X 10.6.4 clients had been setup to talk to the server prior to the rebuild. Now on this client, I cannot work out how to get rid of or change the automatically created server accounts in iCal and Mail - everytime you login, these are recreated using the old domain name (and of course don't work).
    In Mail if you remove the server account (from Accounts in Preferences), it just pops back again. I even removed every trace of the old domain name from the apple.com.mail.plist file but when I re-open Mail that darned server account (with the old domain name) just pops up again.
    In iCal its slightly different in that you can remove the account and it stays away while you have iCal open. But as soon as you close and re-open it, that server account just pops up again!
    I thought it might be something to do with Kerberos and found a Kerberos file on the client which had the old domain name throughout it - I changed all these references to the new domain name, but still the same behaviour in Mail and iCal.
    This is doing my head in. Any ideas?

    I have the same problem. Every time that I open iCal on the client a new account is created and an error message shown that I cannot login. I can delete the wrong account in the iCal preferences. However, as soon as I restart, the account and the error message are back.
    How do I "unbind" and "rebind" a client? I searched the "Mac OS X Server
    Open Directory Administration Version 10.6 Snow Leopard" but the only reference to "binding" seems to be in the context of Active Directory which I don't have.
    Any help is greatly appreciated.

  • Hot to get rid of automatically created Mail and iCal accounts on client?

    I have recently setup an OS X 10.6.2 Server for our small office. I got the domain name wrong in the initial install and fixed this by doing a complete clean reinstall of OS X 10.6 server (then upgrade to 10.6.2).
    The problem is that one of the OS X 10.6.2 clients had been setup to talk to the server prior to the rebuild. Now on this client, I cannot work out how to get rid of or change the automatically created server accounts in iCal and Mail - everytime you login, these are recreated using the old domain name (and of course don't work).
    In Mail if you remove the server account (from Accounts in Preferences), it just pops back again. I even removed every trace of the old domain name from the apple.com.mail.plist file but when I re-open Mail that darned server account (with the old domain name) just pops up again.
    In iCal its slightly different in that you can remove the account and it stays away while you have iCal open. But as soon as you close and re-open it, that server account just pops up again!
    I thought it might be something to do with Kerberos and found a Kerberos file on the client which had the old domain name throughout it - I changed all these references to the new domain name, but still the same behaviour in Mail and iCal.
    This is doing my head in. Any ideas?

    I have the same problem. Every time that I open iCal on the client a new account is created and an error message shown that I cannot login. I can delete the wrong account in the iCal preferences. However, as soon as I restart, the account and the error message are back.
    How do I "unbind" and "rebind" a client? I searched the "Mac OS X Server
    Open Directory Administration Version 10.6 Snow Leopard" but the only reference to "binding" seems to be in the context of Active Directory which I don't have.
    Any help is greatly appreciated.

  • Simultaneous Mail and iCal problems - iCal shows old to-dos

    I was getting ready for my weekly backup, so I ran all the cleaning activities in OnyX. Then when I logged in after the restart, Quicksilver crashed on me 3 times in a row and acted as if I was installing it for the first time. I did not, however, have to completely reset Quicksilver. It did remember most of my settings.
    Once I dealt with Quicksilver, I launched SuperDuper for the back up. SuperDuper, however, asked me to register the software. I've had to re-enter license numbers for other products, so I didn't think much of it. I launched Mail to find the message with my registration info, and that's when I started freaking out.
    Mail and iCal launched simultaneously even though I clearly selected just Mail in Quicksilver. Mail displayed the welcome screen and asked me to set up a new account. iCal displayed about 30 alarms dating from early 2006 to today (9/22/2007). It also asked me if I wanted to changed the time zone setting in iCal to match the change on the computer. My calendars seemed in tact in iCal, but my to-do list is completely outdated. I now have old action items dating back to 8/2006.
    After several other trouble shooting steps detailed in another post (http://discussions.apple.com/thread.jspa?threadID=1145401), Mail opened up by itself (no iCal) and all my accounts and messages were there.
    iCal, however, still has all the old to-do items.
    Does anyone know or have any idea why this happened and how I can fix the to-do list?
    Thanks!

    No problem with Calendar but Mail keeps syncing with the server.  The activity window is full all the time - apparently re-syncing though no new mail is downloaded.  Rang in but they have no idea what's causing it and have sent diagnostic to engineers.  In 10.8, just a quick burst of activity when mail was checked for but now it's constant.  As a result, emptying the Deleted Items mailbox is very slow.  Am worried about the amount of bandwidth being eaten up.

  • Entourage Tasks and iCal "To dos" have disappeared during sync with .Mac

    All of my “tasks” (both completed and incomplete) in Entourage and "to dos" iCal have disappeared, apparently during a sync with dot Mac. This problem has happened twice in the past two weeks (the first time I lost all of my Entourage “notes” too, but I haven’t put any back).
    The tasks show no problems for a week and then all of a sudden disappear from both Entourage and iCal. My calendar and address book (which I also sync) seem not to be affected. Entourage doesn’t seem to offer a way to sync the calendar without syncing the tasks as well.
    Here are my questions:
    Why did my tasks disappear?
    How do I prevent their disappearance again?
    has anyone else experienced this problem?
    My Entourage database is fine. I’m running Entourage 11.2.3 (which rencently added a feature "sync services" that allows syncing with .Mac and iCal).

    I had the same problem and I got my To Dos to appear when I clicked on the To Dos by Priority column header and checked/unchecked the Hide Items outside Calendar View option. (Doesn't seem to make any difference whether it is checked or unchecked ... it displays all of the items ... at least until restart iCal ... then it is a bit unpredictable.)
    I also have intermittent problems when I create or change a new Event. Sometimes the change does not appear until I move off the page that I am displaying and come back (e.g. move forward a week in week view and then back.)

  • How do i restore synching between Treo 650 and iCal & Address Book

    prior to installing 10.4.7, i was able to sync my treo 650 with iCal and Address Book; iCal and Address Book syncs with .Mac and Entourage; Entourage syncs with Outlook on my office pc; and Outlook syncs with my Blackberry 8700. therefore, all i needed to do was enter an appointment or a contact in one device, and all the three other devices would be in sync.
    i recently upgraded to 10.4.7 and now, i have problems synching: (1) iCal and Address Book can no longer sync with my treo 650, and (2) iCal and Address Book can't sync with Entourage either.
    after installing 10.4.7, i noticed that my treo 650 cant sync with iCal and Address Book. i always get the error "isync conduit synchronization failed. ( the first time it happened, i checked isync, and i noticed that "enable palm os synching" was unchecked, so i enabled palm os synching. after that, i was able to sync my palm, but for one time only. after that, i couldnt sync anymore.)
    at the same time, i noticed that iCal and Address Book wouldnt sync with Entourage anymore.
    i also noticed that iCal starts-up even if i dont activate it. when iCal starts-up, the beach ball spins for around two minutes before it responds; if i click an entry to edit it, the beach ball would likewise spin for a minute or two before i can edit it. i went through all the entries and noticed that some have multiple alarm entries: i deleted these and iCal no longer slows down.
    however, whenever i launch Entourage or iSync, iCal also launches. unfortunately, no synchronization takes place.
    can somebody help? how do i restore synching between my treo 650 and iCal & Address Book? how do i restore synching with Entourage? thanks.

    Bon asis,
    I have the exact same situation. Sorry this doesn't help, but wanted you to know that someone else is in the same exact boat.
    Jim

  • MacBook Pro 10.6.8  My @me account has been wiped of all mail, will not send or receive and iCal will not recognise user name or password even though i haven't changed it.  All this after a scheduled software update. Any ideas??

    MacBook Pro 10.6.8  My @me account has been wiped of all mail, will not send or receive and iCal will not recognise user name or password even though i haven't changed it.  All this after a scheduled software update. Any ideas??

    kwmlr439 wrote:
    CSOUND Read the title please:
    Re: Macbook Pro 10.6.8 RAM Upgarde to 8 GB
    The amount of RAM is not dependant on the operating system. It is all about the model of you Mac.
    10.6.8 is the version of OS X that is installed on your system. It has no real baring on the amount of RAM that CAN be installed.
    Personally I have never had good luck with Corsair RAM. I have always had good luck with Crucial and Kingston.
    Message was edited by: Shootist007
    Message was edited by: Shootist007

  • Applescript and automator

    I have studyed html for 3 days and wordpress for 3 days , word , excel for 5 days, and llustrator and photoshop 13 yeas ago for 6 months.
    and still now its so hard to understand some how.
    but I am in need of understading now with the printed documents from my computer.
    and I wonder , so there are many defferent way to communicate with anyone out side of the world, right?
    like I know email , fax, facetime,
    but there are other way now I think because of the documents I found.
    and also with applescript and automator can do anything possible like even the child can click one and start conecting etc..
    I have the copy from its ,
    does anyone have time to explain me what it is?
    It's not that of teenager who doesn't want paretns to know or else,
    but I am quite serious for my situations.
    Please Help !
    Mac OS snow leopard to lion to moutain lion,,,,,
    but I don't know when it started yet.

    Using JavaScript to script System Events wouldn't be any better, since it uses the same Apple Events mechanism (how well it uses it is another topic).  To hold down a key you would need to use something that has access to the deeper system APIs, most likely using Xcode.
    And yes, your code snippet will press the arrow key 5 times (I am guessing that the missing space in key code is a typo).  You can place the cursor in a bunch of text in another application such as TextEdit, and use your script to activate it before performing the key codes to get a better idea of what is happening (trying to reposition the cursor in the Script Editor will reveal a bug with the delay command).

Maybe you are looking for

  • Changing of Vendor Reconciliation Account in master

    Dear friends, I would like to know the steps of changing the Vendor reconciliation account in master. After changes whar are the steps to correct the Balance sheet accounts..?? We have already having existing in the old recon account I would like to

  • Data not seen in RSA3 after setup table was filled

    HI We have an issue where we do not see data for Sales Orders and Deliveries in RSA3  (and hence is missing in BW). For sales orders we are missing 6 months' data and for Deliveries we are missing data from june to october 2007. We checked the sales

  • Apple Menu and iTunes locked up

    iTunes was unresponsive and I couldn't use the Apple drop-down menu either. Force Quit showed no applications running. I could use the internet and got the information on resetting the MSC(?) by unplugging the power cord while holding the power butto

  • Overpaid subscription

    This is the most difficult site to use in the world The support skype link does not work and has not worked for months The refund link does not work either It is a mission to get anywhere. I inadvertently kept adding subscriptions in April in fact ad

  • How to set the server root directory in 10.1.3 ?

    Hi all, I've recently migrated from 1012 to 1013. Unfortunately, i'm having problems compiling the .jsp portion of my project. Every .jsp comes up with the error: "Error: JSP Files must reside in the server root directory or a subdirectory beneath it