Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Additional script

151 views
Skip to first unread message

Alexander Ross

unread,
Mar 25, 2025, 2:08:37 PMMar 25
to Google Apps Script Community

Ckd Food Calculator 


https://docs.google.com/spreadsheets/d/1ufE4liu04Yfs-ZNNIZ2DeZOUfjWz9tVDyhOYvku8pD4/edit


This a copy of my calculator for planning my CKD diet. Hyde wrote a very useful script in which columns c select items for the recipe. Column d weight of ingredients q/10. D4 number of portions. B4 title. B6 post the results to recipe sheet. C6 clears column 6. What I want to do is a similar script which would post to a third page the items selected then clear the selected items using the same layout. This will give me a total food for the day. I’m not sure on where to put the script. Is it added to the existing script ? Or do I start a new script in the second page. Further more I’m trying to write the amendments on an iPad. Thanks. 

George Ghanem

unread,
Mar 25, 2025, 7:20:14 PMMar 25
to google-apps-sc...@googlegroups.com

All tabs un one spreadsheet share the same AppsScript. So it is not starting another script but adding to your existing AppsScript code.


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/8ed33d48-49e4-4f98-ba4a-8c1d4cd3667cn%40googlegroups.com.

Alexander Ross

unread,
Mar 26, 2025, 3:53:19 AMMar 26
to google-apps-sc...@googlegroups.com
Hi George. 
Thanks for your reply. So I can understand this what you are saying is I can copy Hydes original script change the references and paste it to the bottom of the existing code?
Regards 
Beetle 

On boat. Somewhere up North 07770761102


You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/wyPJIR8OqPU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/CAA4K68adYxd-kU-3u6QRKuBCnfcSQ9zramXbrjLifAwgQshzPA%40mail.gmail.com.

Alexander Ross

unread,
Mar 26, 2025, 1:50:38 PMMar 26
to google-apps-sc...@googlegroups.com
Hi George.  

Apologies for annoying you again. 
I have become very frustrated with this and need a lot of help. I tried to copy Hyde’s original script unfortunately unable to do it. Need to register the App. A while ago it was simple, now it seems you have to jump through many hoops. This I find very confusing it seems I have to register for a cloud account which I tried to do. Made a spelling error and couldn’t delete it. I tried to locate the original file from Hyde’s script, but couldn’t find it. I’m not sure where to go from here. A few pointers would be greatly appreciated. 

Regards
Beet

On boat. Somewhere up North 07770761102

George Ghanem

unread,
Mar 26, 2025, 2:36:40 PMMar 26
to google-apps-sc...@googlegroups.com
Hi,

Yes, you can do that. I have not looked at your script. But only thing you also need to watch out for is how these scripts are invoked.

For example if the script is triggered by an onEdit trigger, you can only call one script. So depending on how they are invoked will dictate whether you can have 2 functions or if you need to merge them as one.

Hope that helps. Feel free to reach out if you have other questions.

George Ghanem

unread,
Mar 26, 2025, 2:38:08 PMMar 26
to google-apps-sc...@googlegroups.com
No there is no need to register for a cloud account. You can run simple scripts without an account.

But you do need to authorize them. Is that the issue?

Alexander Ross

unread,
Mar 26, 2025, 4:05:36 PMMar 26
to google-apps-sc...@googlegroups.com
Hi George. 
Thanks for  your response. I was unable to even copy the original script so that I could paste it into an editor to modify it. All I got was two blue buttons but couldn’t expand it in order to copy it. There was a box of edit commands, in the middle of the page, which  couldn’t read. It is very frustrating and I’m at a  loss on how to proceed.    How can I duplicate the script?  
Regards 
Beetle 



On boat. Somewhere up North 07770761102

Alexander Ross

unread,
Mar 31, 2025, 6:19:06 AMMar 31
to google-apps-sc...@googlegroups.com
Hi George 

I have managed to add the script, however I’m getting some error messages with which I’m battling to understand. If you could have look at it and give me some feedback it would be much appreciated. 

New link

Beet 

On boat. Somewhere up North 07770761102

George Ghanem

unread,
Mar 31, 2025, 1:44:25 PMMar 31
to google-apps-sc...@googlegroups.com
No problem. I will take a peak this afternoon and get back to you.


George Ghanem

unread,
Mar 31, 2025, 6:34:39 PMMar 31
to google-apps-sc...@googlegroups.com
Hi Alexander,

 I looked at the spreadsheet and code and as far as I can tell, it is working fine. The code is a little convoluted (overly complex for the simple task you need done). But seems to be working fine. I did not get any errors. If you can do a screenshot of the error and send it to me, I can take a second look.

 Thanks,
  George

Alexander Ross

unread,
Apr 1, 2025, 3:32:02 AMApr 1
to google-apps-sc...@googlegroups.com
Hi George 
Thank again for your reply really appreciate it. I have just tried it out and found on the CKD page where Aubergine curry ingredients are marked with a 1 in column c when I check the tick box b6 the items are posted to recipes just fine. However I marked the item in recipes and ticked the box at b5 nothing happened. 
It didn’t throw an error message. 

Regards 

Beet. 

On boat. Somewhere up North 07770761102

George Ghanem

unread,
Apr 1, 2025, 1:24:06 PMApr 1
to google-apps-sc...@googlegroups.com
Yeah the script is only looking at the CKD sheet. It does not trigger on the other sheets.

What would you want it to do if you tick the box in Recipes?

George 


Alexander Ross

unread,
Apr 1, 2025, 1:51:53 PMApr 1
to google-apps-sc...@googlegroups.com
Hi George. 

Your reply is very helpful. The idea behind this is trying to get totals of food eaten during the day, and keep a record of it. I have to be careful of the protein, sodium, phosphate and potassium for the day. What I was finding that I would process a recipe and ignore other dishes of the day, which was complicating my dialysis. So I select items by putting 1 in column C and D in recipes then tick the  tick box B 5 to post the totals into sheet Daily Totals. Apologies for the diatribe but I hope it explains my thinking. 
Regards 

Beet 

On boat. Somewhere up North 07770761102

Reply all
Reply to author
Forward
0 new messages