NeVeR Posted September 27, 2013 Report Share Posted September 27, 2013 I'm making a macro for a planing system we use in work. When we get an project on .. lets say Monday 1st - We know what the next 8 steps of that project is .. as it's the same every time.. We keep all this data in a wiki.. and each time we have to type it out by hand. What i want is to make a macro that will do the hard work. I have the macro promote me for the data i need to start.. Like Project number is stored in T1 and persons name in T2.. then i promote for the date and add it to T3. This is where i'm stuck. If i set Monday 1st as my date I need the macro to be able to know what dates the other steps should be done. So example 1: Project start - Monday 1st Oct 2: Project sent to review - Tuesday 2nd Oct 3: Review complete Send to be built - Wednesday 3rd Oct etc.. idealy I want to be able to store the dates in T tags so i could use the text type tool to pre-write what i wanted. and add the dates. This should work off a normal calender. So if i set my start date to 30th of Oct if would know to do the macro into Nov. So in brief.. I want to be able to add plus one or plus two days etc to my start date.. and have them store in T tags. Can this be done ? thanks. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 27, 2013 Author Report Share Posted September 27, 2013 Also i can't just do " Adjust date +1 to the future " as I might be running this macro on the 1st of the month for a project that wouldn't start until the 15th ( for example ) so the + 1/2/3/4 etc days would need to run from the date I set when prompted. Quote Link to comment Share on other sites More sharing options...
Samrae Posted September 27, 2013 Report Share Posted September 27, 2013 I would try the technique described here: Date String to DateTime Variable. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 27, 2013 Author Report Share Posted September 27, 2013 I don't have ME pro. Just ME3 Quote Link to comment Share on other sites More sharing options...
Samrae Posted September 27, 2013 Report Share Posted September 27, 2013 Sorry. Here is the link to the Macro Express 3 version of that sample macro Run Macro in Variable to Convert a Date Are you aware of the sample macros available here www.macros.com/share.htm? Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 30, 2013 Author Report Share Posted September 30, 2013 Hi, This says "What it does:This sample macro shows how to change a date from MM-DD-YY to DD-MMM-YYYY format using the 'Run Macro in Variable' command." Thats not what i'm asking for. I need to be able to set dates into the future from a given start date. So lets say today it's the 1st of the month. I run this macro and i'm promoted to select the start date of my project. Lets say the start date of my project is 15th. This Macro will then know that the 15th is the 1st day.. and will know the 2nd day is the 16th / 3rd day the 17th etc.. I need it to set these new days into %T% tags so I can use the dates in a text type script. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 30, 2013 Author Report Share Posted September 30, 2013 Here is an example of the what i mean Macro starts and asked for project name ( I can do this part ) Marco prompts for Project start date and stores in T1 ( and anything ) --- Macro logic will run and return the following in text type. Project Name ( from prompt )Copy & SEO Details complete ( this will be the date i selected from the prompt ) :Ready for Review: + 1 day from selected dateReview complete: +2 days from selected dateSend to translation +3 days from selected datetranslation complete:+8 days from selected dateGraphics complete: etcLoad translation /Graphics to CMS: etctranslation Review complete:etcQA Complete: etc The macro needs to know weekends don't count as working days. Quote Link to comment Share on other sites More sharing options...
Samrae Posted September 30, 2013 Report Share Posted September 30, 2013 This says "What it does: This sample macro shows how to change a date from MM-DD-YY to DD-MMM-YYYY format using the 'Run Macro in Variable' command." Thats not what i'm asking for. I suggested that sample macro because I thought the technique described, setting a date format using the "Run Macro in Variable" command, could be adapted to what you need. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted September 30, 2013 Author Report Share Posted September 30, 2013 i downloaded it and it doesn't make any sense to me. Quote Link to comment Share on other sites More sharing options...
redteardrop Posted October 4, 2013 Report Share Posted October 4, 2013 It would be nice being able to do time based math in ME. I would suggest writing a new macro that you can call in your current one (to keep it cleaner). Go to text->date/time and prompt user for date. Make sure you know what format you're using. Use variable->modify string (copy part of text into variable value 3 characters 2 would turn the selected variable into 15 for 08/15/2012) Do this for all 3 dates and you'll have numbers you can start working with and modifying. in the new macro for the date math you'd have set up 3 variables, use an if statement to check what month it is and if the day goes over 30 for the appropriate months, it adds 1 to the month code also. Then set each of the new numbers into a set of variables to call in your main script on writing the new date. The best solution would be to use from the current day. Then you can just use text-> date then set one variable for number of days into the future, etc. But this only works from the current day, if that can be changed combining date/time's promp and date's days into the future setting then it would be better, but I don't know how that can be done. If you're willing to change todays date on your system to the first day you want to use, it'll work better, but that's also more work. I think it also depends on how you want it displayed. June 16, 2012 or 06/16/2012 etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.