Applescript for 'Reported On' date

40 views
Skip to first unread message

adewe...@gmail.com

unread,
Aug 27, 2015, 3:59:56 PM8/27/15
to Merlin2Users
Can anyone tell me if is possible for an applescript to interrogate each activity in turn to see if it has a start date but no end date, and if that condition is true to enter the project status date in the 'Reported On' field in the inspector, so all started but not completed work is scheduled to continue from the status date? I tried to find the merlin applescript pages that users have messaged about but cannot find them. I am hoping that maybe there is an existing script for this as I have never written one before.
Thanks

Vicky Stamatopoulou

unread,
Aug 27, 2015, 4:16:05 PM8/27/15
to merlin...@googlegroups.com
Hello, 

is it Merlin Project scripting what you asked for, correct?

To get all activities of a project

tell application "Merlin Project"
set allActivities to child activities of root project of first document
repeat with act in allActivities
if actual start of act is not missing value then
act
end if
end repeat


end tell


You check for actual start but no actual end, correct?

You may for that reason do something like following …

if actual start of act is not missing value then
if actual end of act is missing value then
end if
end if

to get the status date, you ask for…

given status date of root project of first document


To set the 'reported on’ you set 
set actual values reporting date of act to



The complete script could be something like the following


tell application "Merlin Project"
set statusDate to given status date of root project of first document
if statusDate is not missing value then
set allActivities to child activities of root project of first document
repeat with act in allActivities
if actual start of act is not missing value then
if actual end of act is missing value then
set actual values reporting date of act to statusDate
end if
end if
end repeat
else
display dialog "No status date set, so the script does not know what to do!" buttons {"Ok"} default button {"Ok"}
end if
end tell

Enjoy, Vicky

 


On 27/08/2015, at 9:49 pm, adewe...@gmail.com wrote:

Can anyone tell me if is possible for an applescript to interrogate each activity in turn to see if it has a start date but no end date, and if that condition is true to enter the project status date in the 'Reported On' field in the inspector, so all started but not completed work is scheduled to continue from the status date? I tried to find the merlin applescript pages that users have messaged about but cannot find them. I am hoping that maybe there is an existing script for this as I have never written one before.
Thanks

-- 
You received this message because you are subscribed to the Google Groups "Merlin2Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to merlin2users...@googlegroups.com.
To post to this group, send email to merlin...@googlegroups.com.
Visit this group at http://groups.google.com/group/merlin2users.
For more options, visit https://groups.google.com/d/optout.

Vicky Stamatopoulou

unread,
Aug 27, 2015, 4:18:15 PM8/27/15
to merlin...@googlegroups.com
Just as a side note the complete script works and all other script snippets also… but the script asking for all activities was not correct… 

So to get all activities of a project you may do following

tell application "Merlin Project"
set allActivities to child activities of root project of first document
repeat with act in allActivities
act
end repeat

end tell


Best regards, Vicky

Vicky Stamatopoulou

unread,
Aug 27, 2015, 4:30:03 PM8/27/15
to merlin...@googlegroups.com
I love scripting… 

there is so much which can go wrong ;-)

The complete script I provided, was also setting the 'reported on’ on the project level (row #0) which  then sets the 'reported on’  of all children activities at once. 


To set only the 'reported on’ row by row… 

you may check the outline level first…

So the complete script could be like the following

tell application "Merlin Project"
set statusDate to given status date of root project of first document
if statusDate is not missing value then
set allActivities to child activities of root project of first document
repeat with act in allActivities
if (outline level of act) > 0 then
if actual start of act is not missing value then
if actual end of act is missing value then
set actual values reporting date of act to statusDate
end if
end if
end if
end repeat
else
display dialog "No status date set, so the script does not know what to do!" buttons {"Ok"} default button {"Ok"}
end if
end tell

or to make it even nicer…

tell application "Merlin Project"
set statusDate to given status date of root project of first document
if statusDate is not missing value then
set allActivities to child activities of root project of first document
repeat with act in allActivities
tell act
if (outline level) > 0 then
if actual start is not missing value then
if actual end is missing value then
set actual values reporting date to statusDate
end if
end if
end if
end tell
end repeat
else
display dialog "No status date set, so the script does not know what to do!" buttons {"Ok"} default button {"Ok"}
end if
end tell

Have more fun with the script now, Vicky

adewe...@gmail.com

unread,
Sep 4, 2015, 2:25:38 AM9/4/15
to Merlin2Users
Hi Vicky,

Thanks for these - I tried both the original and the revised scripts however, while the first didn't seem to do anything, the revised one did, however with errors.

What happened is that all activities, including those in the future, were made to start from the status date, ignoring all logic. My end date, which was mid 2016 was changed to the end of 2015. 
On the original plan about 70% of activities were in the future, after running the script it was about 15%; all activities, whether they are already started or not, were pulled back to the Time Now Status Date.

Fortunately I tested the script on a copy of the plan as Merlin Project would not return the plan to its original dates regardless of what I tried (except for CMD-Z). If you want to try it on my project (500 activities) I can send you the file.

Thanks so far.

Ade

Vicky Stamatopoulou

unread,
Sep 4, 2015, 2:28:12 AM9/4/15
to merlin...@googlegroups.com

On 04 Sep 2015, at 12:11 , adewe...@gmail.com wrote:

Fortunately I tested the script on a copy of the plan as Merlin Project would not return the plan to its original dates regardless of what I tried (except for CMD-Z). 

In this case, you will find following Merlin Project feature cool:
File > Revert > Last opened…

If you want to try it on my project (500 activities) I can send you the file.

Yes, I would suggest you do so, please send it to my address and not to the forum. 

Best regards, Vicky 


ade...@icloud.com

unread,
Nov 28, 2016, 1:24:18 PM11/28/16
to Merlin2Users
Hi Vicky,

I tried creating a new script based on the one above (that status all activities that are 'in work'). The new script is meant to reschedule all unstarted activities that are behind the Time Now line to start at the Time Now line, however my scripting is useless and it does not work (in fact it also changed the original so I had to ditch it !).

Can you help with what is needed :-)

Thanks

Ade

Vicky

unread,
Nov 28, 2016, 1:35:04 PM11/28/16
to Merlin2Users
Hi Ade,

>The new script is meant to reschedule all unstarted activities that are behind the Time Now line to start at the Time Now line

your script should move all not yet startet activities to the status date?
You don't need a script for this. Just enable Dynamic planning in Settings > General > Status Date > Dynamic planning > Only expected values

Best regards, Vicky



ade...@icloud.com

unread,
Nov 28, 2016, 4:51:37 PM11/28/16
to Merlin2Users
That's what I expected however I have some activities that do not move to the status date even though they are 0% with no start date so I'm not sure what's happening. If it helps I can send the file. Thanks


On Thursday, August 27, 2015 at 8:59:56 PM UTC+1, adewe...@gmail.com wrote:

Vicky Stamatopoulou

unread,
Nov 28, 2016, 4:55:31 PM11/28/16
to merlin...@googlegroups.com
Maybe those activities (or their assignment rows) have already date constrains? Just select the tasks which do not move automatically to the status’ date, check their start and end dates in the plan-inspector, and remove any entered date constrains.

If they won’t get pushed to the status’ date, you can send the project to the support. 
Best regards, Vicky

--
You received this message because you are subscribed to the Google Groups "Merlin2Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to merlin2users...@googlegroups.com.
To post to this group, send email to merlin...@googlegroups.com.

ade...@icloud.com

unread,
Nov 30, 2016, 5:38:31 PM11/30/16
to Merlin2Users
Hi,

I've sent an XML copy of the project. Lines 314 to 319 are instances of the issue I am seeing.

Thanks
New House.mprojectx.zip

Vicky

unread,
Nov 30, 2016, 5:45:31 PM11/30/16
to Merlin2Users
Hi Ade,

all those items have an actual start date. So they are startet. So they won't be pushed by dynamic shifting.
Just select the lines: 315, 315, 318 and 319 (or just the groups 314 and 317)
remove  their actual start
and they will be pushed to the status date.

Best regards, Vicky

Adrian Childs

unread,
Nov 30, 2016, 6:16:38 PM11/30/16
to merlin...@googlegroups.com
Hi Vicky,

Thanks for the prompt reply.

Hmmm, the actual start dates have not been input by myself but appear to have been auto generated - I have seen loads of this happening when I use the auto-status script you sent some months back on this thread.

Do you know if there are any settings in the application that the auto-status script may trigger? At one stage I was trying to overcome an issue and may have possibly turned a different scheduling method on.

Thanks

Best Regards

Ade



“It is not because things are difficult that we do not dare,
it is because we do not dare that they are difficult”
Seneca
You received this message because you are subscribed to a topic in the Google Groups "Merlin2Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/merlin2users/j0fY_ql4u2Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to merlin2users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages