-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathIntegratedApp.js
More file actions
34 lines (34 loc) · 986 Bytes
/
Copy pathIntegratedApp.js
File metadata and controls
34 lines (34 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
IntegratedApp = {
getUi: function(type){
if(type == "Slides"){
return SlidesApp.getUi();
} else if (type == "Docs"){
return DocumentApp.getUi();
}
},
getBody: function(){
if(type == "Slides"){
return SlidesApp.getActivePresentation().getSlides();
} else if (type == "Docs"){
return DocumentApp.getActiveDocument().getBody();
} else if (type == "Sheets"){
return SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
}
},
getActive: function(){
if(type == "Slides"){
return SlidesApp.getActivePresentation();
} else if (type == "Docs"){
return DocumentApp.getActiveDocument();
} else if (type == "Sheets"){
return SpreadsheetApp.getActiveSpreadsheet();
}
},
getPageWidth: function() {
if(type == "Slides"){
return IntegratedApp.getActive().getPageWidth();
} else if (type == "Docs"){
return DocumentApp.getActiveDocument().getPageWidth();
}
}
};