You need to ask on the forum for Google Apps Scripts, rather than for this
(abandonware) API for external programs.

https://developers.google.com/apps-script/guides/services/authorization#permissions_and_types_of_scripts
may be relevant, but it sounds like one of the many
spreadsheet-related lame bugs that Google Apps Script has which Google
can't be bothered fixing.

See the GAS issue tracker issues containing 'onEdit'
<https://code.google.com/p/google-apps-script-issues/issues/list?can=2&q=onEdit&sort=-stars&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner>
for the list of shame and get out now while there's still time.  Have a
good hard look at some of those.

Microsoft, of all people, seem to 'get it' and are taking developers for
their hosted Office product seriously
<http://msdn.microsoft.com/en-us/office/aa905340.aspx>.  Although you can't
yet use the JavaScript API to install an onEdit handler to the Document
<http://msdn.microsoft.com/en-us/library/office/fp142295(v=office.1501401).aspx>
object in ExcelOnline, you can bet that it won't have the same issues that
the Google Spreadsheets does.

As someone aptly commented on 3-yr-old GAS issue 415
<https://code.google.com/p/google-apps-script-issues/issues/detail?id=415>
recently
... "Wow, you really suck, Google".

regards,
David.


On Tue, Aug 26, 2014 at 8:38 AM, Erin Johnson <
[email protected]> wrote:

> Bumping for help!!
>
>
> On Monday, August 25, 2014 2:29:01 PM UTC-4, Erin Johnson wrote:
>>
>> So here it goes...my supervisor had me create a spread sheet that allows
>> us to automatically calculate the times of different segments of our show.
>> When someone updates the spreadsheet with a new time he wants something to
>> show in the document who last updated it and when (date and time).
>>
>> There is a way to see who revised it by clicking "revision history," but
>> he wants something that shows up in the actual spreadsheet; without having
>> to click any extra buttons. I found two scripts that work (listed below)
>> but for some strange reason when I (the creator of the spreadsheet) make
>> edits it shows my email, the date and time of the update. But when someone
>> else makes an edit it only shows the date and time. EVEN if the updater has
>> a Gmail address, is using  Chrome and the spreadsheet is shared with them
>> under 'can edit.'
>>
>> I used the following scripts:
>>
>> function onEdit(event)
>> {
>>   var r = event.source.getActiveRange();
>>   var comment = r.getComment().replace("Last modified by: ","previously
>> modified by");
>>   r.setComment("Last modified by: " +Session.getEffectiveUser().getEmail()+"
>> on: "+(new Date())+comment);
>> }
>>
>> AND
>>
>> function onEdit(e)
>>
>> {
>>   // Get all information, Cell, Date, User
>>
>>   var sheet = event.source.getActiveSheet();
>>
>>   var cell = event.source.getActiveRange();
>>
>>   var date = Utilities.formatDate(new Date(), "GMT", "dd-MM-yyyy");
>>
>>   var user = Session.getActiveUser().getUserLoginId();
>>
>>   //Write to Cell Comment
>>
>>   cell.setComment(date + " User:" + user);
>>   var user = Session.getActiveUser().getEmail();
>> sheet.getRange(index, (dateCol + 1)).setValue(user);
>>
>> }
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Spreadsheets API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to