数学的な Equation
内の関数の区切り文字を表す要素。EquationFunctionArgumentSeparator
に他の要素を含めることはできません。ドキュメント構造の詳細については、Google ドキュメントの拡張ガイドをご覧ください。
Methods
方法 | 戻り値の型 | 概要 |
---|---|---|
copy() | EquationFunctionArgumentSeparator | 現在の要素から分離されたディープコピーを返します。 |
getAttributes() | Object | 要素の属性を取得します。 |
getNextSibling() | Element | 要素の次の兄弟要素を取得します。 |
getParent() | ContainerElement | 要素の親要素を取得します。 |
getPreviousSibling() | Element | 要素の前の兄弟要素を取得します。 |
getType() | ElementType | 要素の ElementType を取得します。 |
isAtDocumentEnd() | Boolean | 要素が Document の末尾にあるかどうかを判断します。 |
merge() | EquationFunctionArgumentSeparator | 同じタイプの先行する兄弟要素と要素を結合します。 |
removeFromParent() | EquationFunctionArgumentSeparator | 親から要素を削除します。 |
setAttributes(attributes) | EquationFunctionArgumentSeparator | 要素の属性を設定します。 |
詳細なドキュメント
copy()
現在の要素から分離されたディープコピーを返します。
その要素内のすべての子要素もコピーされます。新しい要素には親がありません。
戻る
EquationFunctionArgumentSeparator
- 新しいコピー。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAttributes()
要素の属性を取得します。
結果は、各プロパティ名が DocumentApp.Attribute
列挙型のアイテムに対応する、有効な要素属性のプロパティを含むオブジェクトになります。
var body = DocumentApp.getActiveDocument().getBody(); // Append a styled paragraph. var par = body.appendParagraph('A bold, italicized paragraph.'); par.setBold(true); par.setItalic(true); // Retrieve the paragraph's attributes. var atts = par.getAttributes(); // Log the paragraph attributes. for (var att in atts) { Logger.log(att + ":" + atts[att]); }
戻る
Object
- 要素の属性。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getNextSibling()
getParent()
要素の親要素を取得します。
親要素には現在の要素が含まれます。
戻る
ContainerElement
- 親要素。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPreviousSibling()
getType()
要素の ElementType
を取得します。
getType()
を使用して、特定の要素の正確な型を特定します。
var body = DocumentApp.getActiveDocument().getBody(); // Obtain the first element in the document body. var firstChild = body.getChild(0); // Use getType() to determine the element's type. if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) { Logger.log('The first element is a paragraph.'); } else { Logger.log('The first element is not a paragraph.'); }
戻る
ElementType
- 要素タイプ。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
isAtDocumentEnd()
merge()
同じタイプの先行する兄弟要素と要素を結合します。
統合できるのは、同じ ElementType
の要素のみです。現在の要素に含まれている子要素は、前の兄弟要素に移動されます。
現在の要素がドキュメントから削除されます。
var body = DocumentApp.getActiveDocument().getBody(); // Example 1: Merge paragraphs // Append two paragraphs to the document. var par1 = body.appendParagraph('Paragraph 1.'); var par2 = body.appendParagraph('Paragraph 2.'); // Merge the newly added paragraphs into a single paragraph. par2.merge(); // Example 2: Merge table cells // Create a two-dimensional array containing the table's cell contents. var cells = [ ['Row 1, Cell 1', 'Row 1, Cell 2'], ['Row 2, Cell 1', 'Row 2, Cell 2'] ]; // Build a table from the array. var table = body.appendTable(cells); // Get the first row in the table. var row = table.getRow(0); // Get the two cells in this row. var cell1 = row.getCell(0); var cell2 = row.getCell(1); // Merge the current cell into its preceding sibling element. var merged = cell2.merge();
戻る
EquationFunctionArgumentSeparator
- マージされた要素。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
removeFromParent()
親から要素を削除します。
var body = DocumentApp.getActiveDocument().getBody(); // Remove all images in the document body. var imgs = body.getImages(); for (var i = 0; i < imgs.length; i++) { imgs[i].removeFromParent(); }
戻る
EquationFunctionArgumentSeparator
- 削除された要素。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setAttributes(attributes)
要素の属性を設定します。
指定する属性パラメータは、各プロパティ名が DocumentApp.Attribute
列挙型の項目であり、各プロパティ値が適用する新しい値であるオブジェクトである必要があります。
var body = DocumentApp.getActiveDocument().getBody(); // Define a custom paragraph style. var style = {}; style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.RIGHT; style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri'; style[DocumentApp.Attribute.FONT_SIZE] = 18; style[DocumentApp.Attribute.BOLD] = true; // Append a plain paragraph. var par = body.appendParagraph('A paragraph with custom style.'); // Apply the custom style. par.setAttributes(style);
パラメータ
名前 | 型 | 説明 |
---|---|---|
attributes | Object | 要素の属性。 |
戻る
EquationFunctionArgumentSeparator
- 現在の要素。
認可
このメソッドを使用するスクリプトには、次の 1 つ以上のスコープによる承認が必要です。
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents