Is there any way to see the script code for the action that I performed?

I am new to scripting in Google Apps. I am trying to execute a script with various actions in Google Docs that I would previously do through the main user interface. Is there a way to "record" such actions as they are performed, similar to recording a macro in Excel?

For example, I create a form in Google Docs. Using the main interface, I can add an image element and load the image from another source (Google Drive, my desktop, etc.), but I cannot develop script code that would perform the same action. Is there a way to output a script that would perform the same action that I just performed?

Thank you very much.

+4
source share
2 answers

You cannot currently record a macro.

In the “Tracking Problems” section there is a problem (issue 650) , in which Google mentioned that this is not possible at the moment (July 2010), you can ask a question in order to register your interest in a request for promotion.

+4
source

I think the real problem is that the GApps script functions are manipulations with the underlying document object model. The user interface also controls the underlying object model, but no one has yet created functions to emulate the user interface in the form of a GApps script. Recording actions will then be a separate step, and converting recorded actions to GApps functions will be another step.

So, you need to be clear: is your goal to record and play back user interface actions, or is your goal to upload an image to GDoc? You asked about the recording and what you got. Perhaps if you ask how to use GApps to add images to GDoc, you will get a more useful answer.

My personal question is:

I did not understand how to use GApps documentation very efficiently. I have a lot of barren hunting. How to find in docs how to add image to GDoc?

Hope this helps.

0
source

Source: https://habr.com/ru/post/1481190/


All Articles