How to Preform a Calculation on the Day of the Month?

I would like to take the day part of the month (e.g. the "2" from 02 March) and multiply it by 7 and then display this value on a prompt.

This is what I have tried
Set VarA to (%ICUDateTime%dd%)*7

I then place VarA in my prompt (as %Variable%VarA%).

But it just prints out as (02)*7

I have also tried setting VarA to %ICUDateTime%dd%. And then creating VarB and setting it to (%Variable%VarA%)*7 but it still doesn't work.

Any ideas?

Hey Mahdu,

I think you're juxtaposing setting a variable to text and setting a variable to a calculation.

In future please post your work, so we can see/test the actual macro – it saves everyone time and aggravation.

If you haven't read these they're worth a couple of minutes of your time:

Tip: How Do I Get The Best Answer in the Shortest Time?

How to Post Your Macro to the Forum


Here's how to do what you want in text fields:

Keyboard Maestro Actions.kmactions (567 B)

It gets more interesting when you try to do date math in calculation fields.

REF:

Set Variable to Text action

Set Variable to Calculation action

-Chris

1 Like