forked from zlovatt/zl_Scriptlets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewTextLayer.jsx
39 lines (30 loc) · 1.1 KB
/
newTextLayer.jsx
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
35
36
37
38
39
/**********************************************************************************************
newTextLayer
Copyright (c) 2017 Zack Lovatt. All rights reserved.
Name: New Text layer
Version: 1.1
Description:
Makes a new empty text layer.
If you want a paragraph text layer, set makeParagraphText to true
Otherwise, will be point text
This script is provided "as is," without warranty of any kind, expressed
or implied. In no event shall the author be held liable for any damages
arising in any way from the use of this script.
**********************************************************************************************/
(function newTextLayer () {
var makeParagraphText = false;
app.beginUndoGroup("New Text Layer");
var thisComp = app.project.activeItem;
if (thisComp === null || !(thisComp instanceof CompItem)){
alert("Please select a composition!");
} else {
var newTextLayer;
if (makeParagraphText)
newTextLayer = thisComp.layers.addBoxText();
else
newTextLayer = thisComp.layers.addText();
newTextLayer.selected = true;
}
app.endUndoGroup();
})();