Applescript: Shifting activity starting dates at once

AppleScriptFrom time to time we get asked in support, how to shift all given planned starting dates at once in Merlin projects to a new date while maintaining the slacks.

If the activities are linked together, the user may use the dynamic shifting project setting, and define a new planned starting date for the first activity. The linkages between activities will shift the successor activities as needed.

If the activities are set to specific starting dates, and you want to shift them all by the same amount of time, you may consider writing an AppleScript to read the given planned earliest start dates of the activities, apply the desired time offset, and write the new date back onto the activities of the project.

But why bothering writing a new Applescript from the scratch, when there is already one which we have just written doing so? Spend your time on managing your projects, not on scripting. Be lazy and productive. Just click here to download it 🙂

UPDATE on August 26th, 2010 : The script was not handling activities with given planned earlier end dates, this possibility is now also covered.

9 thoughts on “Applescript: Shifting activity starting dates at once

  1. Hi Vicki!
    This script is great! I was wondering if there was any way for me to modify it to adjust ACTUAL START rather than the planned start date?
    Thank you!

  2. This is rather unusual. Is the whole set of actual dates mistakenly entered on false dates? I understand the need of changing the planned values, but actual values show actual progress, and it does not make sense to change the actual start on an activity you have already started working on later on.
    Anyhow the property is called ‘actual start date’.
    So you can modify the script to get the “actual start date” from act (instead of the ‘planned start date’) and write back into “actual start date”.
    Regards, Vicky

  3. Thanks Vicky! I know it’s unusual; I think I’m using Merlin in a bit of a hacky way… I made a post about it on Friday, on the user forum, but it hasn’t been moderator-approved yet. I’m new to project management software and I’m basically just trying to use this in the way that my workplace needs, so I’m kind of shooting in the dark. We have a very deadline-based workplace and I don’t want task dates to change if the previous task gets done quicker… so I’ve been using actual dates instead of planned dates, so they stay put.

  4. Hi Vicky,

    I’m currently using Merlin to plan a research project. I’ve entered a bunch of activities and tasks with precise quarterly ‘given’ start and end dates (so they show up as neat blocks in the Gantt chart using quarters as the unit, which is my main concern at this stage).

    I’d now like to shift the whole project to start one quarter later. I’m not familiar with Applescript, but I guess the one you provided shifts only start dates, not end dates? If so, could you advise on how to change it so that the ‘given’ start and end dates both get shifted?

    BTW, I noticed the following in the (freshly downloaded) script, which appears to be a typo:

    set chossenFile to (choose file)
    open chosenFile

    Regards, Peter

  5. Oh.. thanks for mentioning the typo… sure, it won’t work this way.

    True, it shifts the start day, which is usually enough if you plan with start day, work or duration.

    In tasks where you only have start and end dates, but no work or duration it won work well.

    In that case the following should be entered
    in the “if class of act is not project then” block:

    set TaskEndDate to (given planned end date min of act)
    if TaskEndDate is not missing value then
    tell application “Finder” to set myEndDate to TaskEndDate + (TheOffset * days)
    set given planned end date min of act to myEndDate

    end if

    I will update the script accordingly and upload it in short.

    Thanks 🙂

  6. Many thanks for the quick response and the updated script!

    I tried using the new script to shift my project 65 days, but the result wasn’t so regular as the original – probably due to me not being completely systematic in the way I set activities – so I’ll now switch to using months of duration instead of precise end dates, and then try shifting again.

  7. Using emonths for duration (instead of months) and avoiding precise dates as much as possible gave a neat-looking Gantt, which is now easy to shift when needed.

  8. Thanks for this script! Saved me a lot of time 🙂 the only thing i noticed was that leap years seem to interfere in the script somehow (i had a 5-year project and i had to correct a couple of entries which had 1 or 2 days still behind) but i think it’s something small. Thanks again!

Comments are closed.