1)Is there a Google Appscript command that can convert a .gDraw to a .jpg? 2)Can a trigger be set to perform this conversion on .gdraw file edit? -


1) Is there a Google Appscript command that can convert .gdraw to .jpg?
2) Can Google .gdraw file edit be set to this conversion?

1) My answer is so far (in Google / Phony Code)

  function gDrawTO_jpeg () {Var gDrawFile = DriveApp.getFilesByID ('gDraw_fileID') gDrawJpg = gDrawFile. GDrawPdf = gDrawFile.getAs ("App / PDF");} does not work due to known disturbances, because of getAs ("image / jpg") // current getAs () boundaries does not work,  

The following is a mistake in converting files to PDFs on Google.

Is this an alternative solution for an obscure blob function?

2) My answer is still:

  function triggerSet () {ScriptApp.newTrigger ('GDrawTO_jpeg') .forDocument ('gDraw_fileID') .onOpen (). Create (); // error on this line}  

Works only on Google Docs / Sheets / Forms, no success Does a blob work with gidra?

** As a commentary on this question, it would be great for GDR / GDOS to feature or option for autosaving / standard / docs / sheets / gedras or non-Google format (. Doc / .xls/ .jpg respectively, they have this feature manually, but there are different benefits automatically on this).

A detailed description of the work-around that you liked.

Important: To work around, you must enable the Drive API in your project and advanced services in the Developer Console:

  1. In Go to your script Project menu Resource-> Advanced Google Services and turn on Drive API service.
  2. Click the Developer Console link under the Advanced Google Services dialog box, and after that you can enable the Drive API.

After the above code, you will get your drawing as a JPEG file:

  function gDrawTO_jpeg () {var gDrawFile = Drive.Files.get ( 'Your_draw_file_ID_here'); Var url = gDrawFile.exportLinks ['image / jpeg']; Var Token = ScriptApp.getOAuthToken (); Var response = UrlFetchApp.fetch (url, {header: {'authorization': 'barrier' + token}}); Var jpeg = response.getBlob (); // Save drawing as a jpeg file, or whatever you need with Blob DriveApp.createFile (jpeg); }  

For the second part of your question: No. Google does not support the Draw App Script (yet)


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -