Jump to content

Need Help With a Simple Script

TheSlicingEdge

So basically I don;t know much programming I know some very basic html and css. I want to make a script that I can run in google docs so that every time I make a new google doc it auto-creates a heading with the days date and other assigned text.  for example I want it to make a header that goes to the left with 

(a name to be specified by user)

7HB(my current class)

(assignment number)

(date of creation of the google doc)

 

so my original intention was to make this but I really don't know what would be needed or if this is possible. So I am asking you for guidance on how I should go about this. should i just not make it? should I start learning like Jscript or something?  (Although i would love to make this myself you could all so make one if you heart desires)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

just write it all in a document and call it template then right click and create copy. It will make a copy so you don't overwrite the template.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, vorticalbox said:

just write it all in a document and call it template then right click and create copy. It will make a copy so you don't overwrite the template.

that is not exactly what I want though. I want it to automatically make the date the current day.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

You need to use XML, the basis of google docs and any rich-text format text processor is XML, the basic idea is that you create a script that pastes XML-XPATH code to a document.

You can search ImportXML for more information, but I recommend learning from scratch XML, because is a very robust language.

Link to comment
Share on other sites

Link to post
Share on other sites

41 minutes ago, Jorge Reus said:

You need to use XML, the basis of google docs and any rich-text format text processor is XML, the basic idea is that you create a script that pastes XML-XPATH code to a document.

You can search ImportXML for more information, but I recommend learning from scratch XML, because is a very robust language.

from what I learnt is that there is nit really a set way to do anything, tags are what you want.

so long as you open and close tags in the correct order its up to you.

 

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

could you show with a screenshot how you would want it to look like, I made a little script that will ask you to fill in your name+assignment number, but i don't know how you want the end result to look like.

(I am using AHK for the script, fun scripting language)

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/13/2016 at 11:24 AM, gemina said:

could you show with a screenshot how you would want it to look like, I made a little script that will ask you to fill in your name+assignment number, but i don't know how you want the end result to look like.

(I am using AHK for the script, fun scripting language)

I don't care how it looks. Format wise it has to be on the top left with the following

 

                        (Name)

                        (Class)

#(number and a letter)

(the days current date)

 

and it should be formated so that the last charcter if every line lines up with ones above and below it.

 

make sense?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, TheSlicingEdge said:

I heard that you cant run that on all of your documents. Meaning a script is only for one doc.

you can create multiple docs i think by calling this function more than one? not 100% sure though

var doc1 = DocumentApp.create("document" + new Date());

https://developers.google.com/apps-script/guides/docs

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, mikat said:

you can create multiple docs


var doc1 = DocumentApp.create("document" + new Date());

https://developers.google.com/apps-script/guides/docs

tried that but i want the text to be a header

 

                        (Name)

                        (Class)

#(number and a letter)

(the days current date)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, TheSlicingEdge said:

I dont know what your talking about. Dont have much Js experience

 

the function DocumentApp.create() is a function that creates a new google docs document, it returns an object with all the functions inside it to do stuff with the document, if you execute my script it will create a document named document Sat Sep 17 2016 01:25:08 GMT+0200 (CEST) :) (current time)

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, mikat said:

the function DocumentApp.create() is a function that creates a new google docs document, it returns an object with all the functions inside it to do stuff with the document, if you execute my script it will create a document named document Sat Sep 17 2016 01:25:08 GMT+0200 (CEST) :) (current time)

read my other post

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, TheSlicingEdge said:

read my other post

Can you provide an example? with proper info and how you want that info to get into the script (like setting variables at the beginning of your script with your name & class)

 

edit: its really late and i gtg to bed, ill answer your questions tomorrow (message so you know im not ignoring you :))

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, mikat said:

Can you provide an example? with proper info and how you want that info to get into the script (like setting variables at the beginning of your script with your name & class)

is there and E-mail you can PM me that I can share a google doc with the formatting with you?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

this program will ask for your name and class and the assignment number, and will post it at the current location of your cursor in the file. you will need to run it before you can use it. type "postdata" to activate the script when you need it. the .exe is ussable for everyone but the .ahk is readable for humans.

postdata.exe

postdata.ahk

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/20/2016 at 0:57 AM, gemina said:

this program will ask for your name and class and the assignment number, and will post it at the current location of your cursor in the file. you will need to run it before you can use it. type "postdata" to activate the script when you need it. the .exe is ussable for everyone but the .ahk is readable for humans.

postdata.exe

postdata.ahk

on a mac atm will test in couple days

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×