r/GoogleAppsScript • • Feb 25 '21

Question Questions re new IDE

  • How do you view script properties in the new IDE?

  • How do you search for a string across all the .GS files in a project? (CTL+F searches only the current .GS file and you have to manually switch to each one in turn to search them. )

Suggestions welcome!

6 Upvotes

4 comments sorted by

4

u/dimudesigns Feb 25 '21 edited Feb 25 '21
  • How do you view script properties in the new IDE?
    Currently there is no option in the new IDE that allows for that. One workaround is to write a custom function to log your properties to the console. The following script should do the trick:

    function logScriptProperties {
        let properties = PropertiesService
            .getScriptProperties()
            .getProperties();
    
        console.log(JSON.stringify(properties, undefined, 4));
    };
  • How do you search for a string across all .GS files in a project?

    Unfortunately, we no longer have that option in the new IDE. As you are well aware, CTRL+F only searches the current script file. However, you can select and right-click elements of your code (variables, objects, functions, classes) and select 'Get References'. That should give you a list of references to that element across all script files in your project.

3

u/wmaxsen Feb 25 '21

It's not what OP asked, but well, I have just tried the instructions given at Develop Google Apps Script Locally in VSCode using CLASP and now I am using VS Code + CLASP in my Google Apps Script projects, with all the functionalities provided by its extensions. I know that the new IDE is much better, but it doesn't compare with VS Code, in my newbie opinion.

2

u/takishan Feb 26 '21

I also made a brief tutorial about this on github for those that don't wanna watch a 30 min video https://github.com/gscharf94/Clasp-Basics-for-Reddit

2

u/burkybang Feb 26 '21

I definitely prefer developing locally too. It’s great because I can use whatever tools I normally like using. I use WebStorm, and I compile from TypeScript before uploading via clasp. I know clasp can compile TypeScript too, but there’s way less control, and I can’t set the target version of JS. The target version that clasp uses is older than what GAS uses now.