is it possible save code with syntax errors?

100 views
Skip to first unread message

stephen pastore

unread,
Nov 14, 2019, 10:36:15 AM11/14/19
to Google Apps Script Community
 Hello,  I just wanted to quickly know if there's any way to Save code within the Google script editor that has syntax errors in it?   sometimes I explicitly write code that is incorrect  to represent  the incorrect  syntax  as it is helpful sometimes  to see that. thank you

Alan Wells

unread,
Nov 14, 2019, 10:52:41 AM11/14/19
to Google Apps Script Community
There may be some errors that the Apps Script code editor fails to find before saving the code.  I don't know what they are.  I rarely get an uncaught server side error.  Most of the uncaught errors I get are from client side DOM code that fails when the HTML is processed.

Do you want to display incorrect code in the browser as a teaching help?

If you want to display code in HTML, you can use a <code> tag:

<pre style="background-color:#d9d9d9;width:98%;">
<code class="codeWidth">function stop_Accepting_Responses() {
  var thisForm;

  thisForm = FormApp.getActiveForm();//Get the Form

  thisForm.setAcceptingResponses(false);//Set the Accepting Responses status to OFF
 
  sendEmail();
}

function sendEmail() {
  var em,o;
 
  em = Session.getEffectiveUser().getEmail();
 
  o = {
    to:em,
    subject:'Form is Shut Down',
    body:'The Form with ID:\n\n' + thisForm.getId() + '\nTitle: ' +
      thisForm.getTitle() + '\n\nis no longer accepting responses'
  }
 
  MailApp.sendEmail(o);

}
</code></pre>

stephen pastore

unread,
Nov 14, 2019, 11:32:34 AM11/14/19
to Google Apps Script Community
Thank you for your response. I'm actually a complete beginner and I'm just using the script editor for now to simply to write practice code, no  functional purpose for  it other than just practicing.... But now that I come to think about it,  when you're writing code in an HTML editor, it doesn't notify you of or display anything written incorrectly,  so that wouldn't be an issue with HTML? Does it work the same way for CSS?  I originally started with JavaScript  In the Google script editor so that's where I was having this issue where  incorrectly written code  was not being saved  when I needed it to. But  It sounds like you're saying there is no actual setting  or workaround  to save incorrectly written JavaScript  code?

stephen pastore

unread,
Nov 14, 2019, 11:49:08 AM11/14/19
to Google Apps Script Community
I'm thinking that the Google script editor may not be the best option for me. I'm simply trying to write practice code for now in HTML, CSS and JavaScript  in a browser-based editor   so that I can save all of my code in the cloud, not locally. and I need to be able to create many different  files to organize my practice code. would greatly appreciate any suggestions. Thank you

stephen pastore

unread,
Nov 14, 2019, 11:52:04 AM11/14/19
to Google Apps Script Community
And  it has to allow me to save incorrectly written code

CBM Services

unread,
Nov 14, 2019, 12:04:48 PM11/14/19
to google-apps-sc...@googlegroups.com
Get Notepad++. It will let you save anything and has basic formatting support for HTML and JavaScript.

From: stephen pastore
Sent: ‎2019-‎11-‎14 8:52 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: is it possible save code with syntax errors?

And  it has to allow me to save incorrectly written code

On Thursday, November 14, 2019 at 10:36:15 AM UTC-5, stephen pastore wrote:
 Hello,  I just wanted to quickly know if there's any way to Save code within the Google script editor that has syntax errors in it?   sometimes I explicitly write code that is incorrect  to represent  the incorrect  syntax  as it is helpful sometimes  to see that. thank you

--
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 on the web visit https://groups.google.com/d/msgid/google-apps-script-community/588da1e1-c01b-435c-9d09-df1fdb6270eb%40googlegroups.com.

stephen pastore

unread,
Nov 14, 2019, 12:13:36 PM11/14/19
to Google Apps Script Community
Thank you for your suggestion but I'm on Mac and  it's saying it's only for Windows and won't let me download it..... any other Browser-based suggestions? 


On Thursday, November 14, 2019 at 12:04:48 PM UTC-5, George wrote:
Get Notepad++. It will let you save anything and has basic formatting support for HTML and JavaScript.

From: stephen pastore
Sent: ‎2019-‎11-‎14 8:52 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: is it possible save code with syntax errors?

And  it has to allow me to save incorrectly written code

On Thursday, November 14, 2019 at 10:36:15 AM UTC-5, stephen pastore wrote:
 Hello,  I just wanted to quickly know if there's any way to Save code within the Google script editor that has syntax errors in it?   sometimes I explicitly write code that is incorrect  to represent  the incorrect  syntax  as it is helpful sometimes  to see that. thank you

--
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-community+unsub...@googlegroups.com.

CBMServices Web

unread,
Nov 14, 2019, 12:23:04 PM11/14/19
to google-apps-sc...@googlegroups.com
Try to see if you can get the Microsoft Visual Studio software. There is a free version and they may have a Mac version.

On Thu., Nov. 14, 2019, 9:13 a.m. stephen pastore, <stephe...@gmail.com> wrote:
Thank you for your suggestion but I'm on Mac and  it's saying it's only for Windows and won't let me download it..... any other Browser-based suggestions? 

On Thursday, November 14, 2019 at 12:04:48 PM UTC-5, George wrote:
Get Notepad++. It will let you save anything and has basic formatting support for HTML and JavaScript.

From: stephen pastore
Sent: ‎2019-‎11-‎14 8:52 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: is it possible save code with syntax errors?

And  it has to allow me to save incorrectly written code

On Thursday, November 14, 2019 at 10:36:15 AM UTC-5, stephen pastore wrote:
 Hello,  I just wanted to quickly know if there's any way to Save code within the Google script editor that has syntax errors in it?   sometimes I explicitly write code that is incorrect  to represent  the incorrect  syntax  as it is helpful sometimes  to see that. thank you

--
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.

--
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 on the web visit https://groups.google.com/d/msgid/google-apps-script-community/484f8e45-5efc-45e6-ac5f-d8ddd8f8954c%40googlegroups.com.

stephen pastore

unread,
Nov 14, 2019, 12:26:26 PM11/14/19
to Google Apps Script Community
I will take a look thank you.


On Thursday, November 14, 2019 at 12:23:04 PM UTC-5, George wrote:
Try to see if you can get the Microsoft Visual Studio software. There is a free version and they may have a Mac version.

On Thu., Nov. 14, 2019, 9:13 a.m. stephen pastore, <stephe...@gmail.com> wrote:
Thank you for your suggestion but I'm on Mac and  it's saying it's only for Windows and won't let me download it..... any other Browser-based suggestions? 

On Thursday, November 14, 2019 at 12:04:48 PM UTC-5, George wrote:
Get Notepad++. It will let you save anything and has basic formatting support for HTML and JavaScript.

From: stephen pastore
Sent: ‎2019-‎11-‎14 8:52 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: is it possible save code with syntax errors?

And  it has to allow me to save incorrectly written code

On Thursday, November 14, 2019 at 10:36:15 AM UTC-5, stephen pastore wrote:
 Hello,  I just wanted to quickly know if there's any way to Save code within the Google script editor that has syntax errors in it?   sometimes I explicitly write code that is incorrect  to represent  the incorrect  syntax  as it is helpful sometimes  to see that. thank you

--
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-community+unsub...@googlegroups.com.

--
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-community+unsub...@googlegroups.com.

Trevor Scanlan

unread,
Nov 14, 2019, 1:19:10 PM11/14/19
to google-apps-sc...@googlegroups.com
You could 'comment out' the code if it gives you trouble saving. This would keep whatever code that is commented out from being checked. It's great you are practicing. Not getting discouraged is usually harder than the code. Use a block style comment to comment out entire chunks or the whole code. You can use a line comment to 'hide' a specific line but this may also break the next piece of code so I would say use the block style comment. 

/* busted
code 
in 
between these symbols
*/

You can also highlight or 'select all' and go to Edit ==> Toggle Comment.

--
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 on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ba0fe04f-b320-4be1-928c-e76f579e9402%40googlegroups.com.


--
Trevor Scanlan
Technology Assistant
Shenandoah Community School District
304 West Nishna Road
Shenandoah, IA 51601

Trevor Scanlan

unread,
Nov 14, 2019, 1:22:24 PM11/14/19
to google-apps-sc...@googlegroups.com
Here are a couple online editors that have cloud storage included in its features: https://jsfiddle.net/ and https://codesandbox.io/

stephen pastore

unread,
Nov 14, 2019, 3:37:43 PM11/14/19
to Google Apps Script Community
Thank you for all that!
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.


--
Trevor Scanlan
Technology Assistant
Shenandoah Community School District
304 West Nishna Road
Shenandoah, IA 51601
Reply all
Reply to author
Forward
0 new messages