cartoonle
cartoonle

Reputation: 101

User identity in shared script

According to this http://productforums.google.com/forum/#!topic/apps-script/gGTd0uhh2Kw i can't use Session.getUser().getUserLoginId() to get users identity. How can I know than which user is currently using my script?

Upvotes: 0

Views: 89

Answers (1)

Harold
Harold

Reputation: 3337

you can use

Session.getActiveUser().getEmail();

and to retrieve the information just send you a mail with that information

MailApp.sendEmail("youemailadress", "Hu? someone is using my scipt!", "this is: "+Session.getActiveUser().getEmail());

Upvotes: 1

Related Questions