Macro to track macros?

Fleurdelethal88

New member
Sorry for any ignorance that may come across as I am just beginning to delve into this topic. I work as a driver, so im always gone, and my space/time are incredibly limited. Im trying to be proactive against the sedentary lifestyle plaguing this industry. Could someone show me how to make a macro that either works with a micronutrient tracking app, or one that logs protein, carbs, and fat into a spreadsheet, such as excel, sheets, etc? Im thinking either clicking a trigger button for common meals i eat, or scanning an NFC tag, could be the trigger. From there I could have the spreadsheet do a calculation to keep a running total of each macronutrient. If this is too much, a link or some other assistance would probably suffice. Not sure if it matters, but i have a Samsung Galaxy S9 and a new HP Spectre x360. Thanks in advance.
 

tanutanu

Well-known member
Sorry for any ignorance that may come across as I am just beginning to delve into this topic. I work as a driver, so im always gone, and my space/time are incredibly limited. Im trying to be proactive against the sedentary lifestyle plaguing this industry. Could someone show me how to make a macro that either works with a micronutrient tracking app, or one that logs protein, carbs, and fat into a spreadsheet, such as excel, sheets, etc? Im thinking either clicking a trigger button for common meals i eat, or scanning an NFC tag, could be the trigger. From there I could have the spreadsheet do a calculation to keep a running total of each macronutrient. If this is too much, a link or some other assistance would probably suffice. Not sure if it matters, but i have a Samsung Galaxy S9 and a new HP Spectre x360. Thanks in advance.
Check up a bunch of calorie tracking apps on Play store:)
 
As it happens, I just set up a simple pair of macros for basic diet tracking. I'll probably change a lot, but here's the summary so far.

Tracker Macro

T: 3-hour intervals (marking three daily meals and in-between snacks)

A: enable button macro (when it's enabled, a floating button will appear onscreen)
Probably constrain this action to Interval Trigger fired.

Button Macro
T: floating button

A: macro run tracker macro

Back to Tracker Macro

If Condition: trigger not fired, intervals

A: Confirm Next
Have a prompt to make sure you want to log food and didn't just tap by mistake.

A: disable Button Macro
(makes the button go away until next interval trigger)

A: set variable, Boolean, we might name "usual" as in "having my usual," user prompt.
Gives you option to log something you have often or something you don't

A if "usual" is True: set integer variable to +1
(I've got additional actions to choose from different usuals. Looking into most efficient ways to do this.)

A if "usual" is set to False: user prompt to edit a string variable with written food log entries.

A: Confirm Next
Use magic text to include your records so far.

A: macro run Tracker Macro
Repeats all actions so you can log more food.

End If Condition

My next steps: I'll at least add calorie tracking and estimates. I think whole nutrition panels will amount to simple addition so there's that too.

For your spreadsheet, you'll want to add the webhook action. There may be ways to send variables straight to Excel or Google Sheets.

If we don't find those, I know IFTTT and Zapier will do it. might even be free on ifttt. Zapier charges their premium price to use webhooks, but they also offer more options and functions.

I'll follow this thread and exchange more ideas as we go.
 

420

Active member
(I've got additional actions to choose from different usuals. Looking into most efficient ways to do this.)


For your spreadsheet, you'll want to add the webhook action. There may be ways to send variables straight to Excel or Google Sheets.
Uitask plugin's - "List dialog" action can make some really easy to use lists, maybe that's an idea. You will need to figure out a way to easily add new usuals though, so you/others don't have to edit the list dialog action every time.. This might get pretty complicated but i think it's do-able :p

To put it all in a spreadsheet i believe you can use AutoSheets plugin. ;)
 
Uitask plugin's - "List dialog" action can make some really easy to use lists, maybe that's an idea. You will need to figure out a way to easily add new usuals though, so you/others don't have to edit the list dialog action every time.. This might get pretty complicated but i think it's do-able :p

To put it all in a spreadsheet i believe you can use AutoSheets plugin. ;)
Thank you! I'll see about those plugins. Might slow us down while one of us learns it, though.
 

420

Active member
Thank you! I'll see about those plugins. Might slow us down while one of us learns it, though.
I figured out a way to easily add new usuals to an UItask plugin list dialog, you can see if you like it and maybe learn how it works a bit, just test the empty trigger to add new usuals and test the widget button (green) trigger to show the dialog.

I hope this works btw, i never shared a macro in this way before.. :whistle:
 

Attachments

  • Example (1).macro
    24.7 KB · Views: 6

tanutanu

Well-known member
As it happens, I just set up a simple pair of macros for basic diet tracking. I'll probably change a lot, but here's the summary so far.

Tracker Macro

T: 3-hour intervals (marking three daily meals and in-between snacks)

A: enable button macro (when it's enabled, a floating button will appear onscreen)
Probably constrain this action to Interval Trigger fired.

Button Macro
T: floating button

A: macro run tracker macro

Back to Tracker Macro

If Condition: trigger not fired, intervals

A: Confirm Next
Have a prompt to make sure you want to log food and didn't just tap by mistake.

A: disable Button Macro
(makes the button go away until next interval trigger)

A: set variable, Boolean, we might name "usual" as in "having my usual," user prompt.
Gives you option to log something you have often or something you don't

A if "usual" is True: set integer variable to +1
(I've got additional actions to choose from different usuals. Looking into most efficient ways to do this.)

A if "usual" is set to False: user prompt to edit a string variable with written food log entries.

A: Confirm Next
Use magic text to include your records so far.

A: macro run Tracker Macro
Repeats all actions so you can log more food.

End If Condition

My next steps: I'll at least add calorie tracking and estimates. I think whole nutrition panels will amount to simple addition so there's that too.

For your spreadsheet, you'll want to add the webhook action. There may be ways to send variables straight to Excel or Google Sheets.

If we don't find those, I know IFTTT and Zapier will do it. might even be free on ifttt. Zapier charges their premium price to use webhooks, but they also offer more options and functions.

I'll follow this thread and exchange more ideas as we go.
If you were him, how would you do for frontend?
The data structure is very depend on the tracker app. I don't think OP has enough time to manage the data;) I'm not sure he is forcing on open api, but perhaps he loves all inclusive, easy to do app.
The system outline should be determined by the use cases, never as the data summarizing methods on the backend in any cases..
You are jogging everyday, so you decide to buy smartwatch. It's natural.
You use the desktop exel application, so you start running every morning.
Do you really want to do that? Once realized his scenario, the things OP have to do would be clear:)
 
  • Haha
Reactions: 420
Top