-
position a shape to the end of a text
Hi, maybe it’s not a real problem, I just want to ask you, maybe you have more experiences with this issue.
I’m working with text and shape layers, and don’t use anything, just script files. I want to position a shape to the end of a text, position the next text to the ‘end’ of the shape, etc
The text is changing, and I have to count the positions again and again.
I use the sourceRectAtTime function, to find the end of the text layer, and a constant, to position the shape to the right coordinate. It’s ok, but not perfect.
I realized, that the values from sourceRectAtTime are not the best for me. I made a little script (post it here, and of course, there are some exceptions 🙂 🙂 ) to look how it works, an I find, that last and first characters affect the width more than the others. MAGE.width != AMGE.width, but MAGE.width == MGAE.width
Did you have what can I do – a shorter/easier way – to find the right place for my shapes in the center between two text layers, what are changing? Thank you!
var myComp = app.project.activeItem;
var abc = 'ABCDEFGHIJKLMNOPQRSTUVZ';
var myText = myComp.layers.addText('');
var textSource = myText.property("Source Text");
var output3 = '';
var word, letter1, letter2, resultNUM;for(var i=0; i<3; i++){
letter1 = abc .substr(Math.floor(Math.random()*22),1);
letter2 = abc .substr(Math.floor(Math.random()*22),1);for (var j=0; j<7; j++){
word = '';
for (var k=0; k>>/*
P///29.9994142726064
T///25.8761719800532
!word - word : 4.12324229255319
-
P///29.9994142726064
T///25.8761719800532
!word - word : 4.12324229255319
-------PB///79.7273905519396
TB///76.933347530663
!word - word : 2.79404302127659
-
BP///80.8260233644396
BT///74.845945186913
!word - word : 5.98007817752659
-------PAR///122.69540578872
TAR///119.901362767443
!word - word : 2.79404302127659
-
ARP///127.52939016372
ART///120.414058079943
!word - word : 7.11533208377659
-------PACK///165.150729527697
TACK///162.35668650642
!word - word : 2.79404302127659
-
ACKP///171.387155361474
ACKT///165.407077183947
!word - word : 5.98007817752659
-------PCBJB///208.33436610736
TCBJB///205.540323086083
!word - word : 2.79404302127659
-
CBJBP///207.397158971056
CBJBT///201.41708079353
!word - word : 5.98007817752659
-------PVNIBQ///259.981576748192
TVNIBQ///257.187533726916
!word - word : 2.79404302127659
-
VNIBQP///261.838412633166
VNIBQT///255.858334455639
!word - word : 5.98007817752659
-------PKJJCLP///282.672342129052
TKJJCLP///279.878299107775
!word - word : 2.79404302127659
-
KJJCLPP///282.818826504052
KJJCLPT///276.838748326525
!word - word : 5.98007817752659
-------R///30.6585939601064
M///29.9777344800532
!word - word : 0.68085948005319
-
R///30.6585939601064
M///29.9777344800532
!word - word : 0.68085948005319
-------RJ///59.9303201343864
MJ///65.0830544568598
!word - word : -5.15273432247341
-
JR///70.8800271656364
JM///72.0044411756098
!word - word : -1.12441400997341
-------RNK///126.529780736193
MNK///131.682515058666
!word - word : -5.15273432247341
-
NKR///125.907222142443
NKM///127.031636152416
!word - word : -1.12441400997341
-------RTLI///144.679538121447
MTLI///150.96752635017
!word - word : -6.28798822872341
-
TLIR///153.285495152697
TLIM///154.40990916267
!word - word : -1.12441400997341
-------RJTLV///194.067080846056
MJTLV///199.21981516853
!word - word : -5.15273432247341
-
JTLVR///201.244815221056
JTLVM///202.36922923103
!word - word : -1.12441400997341
-------RISBJR///237.056772060692
MISBJR///242.209506383166
!word - word : -5.15273432247341
-
ISBJRR///235.251498570666
ISBJRM///236.375912580639
!word - word : -1.12441400997341
-------RQFGSPB///314.690002704039
MQFGSPB///319.842737026513
!word - word : -5.15273432247341
-
QFGSPBR///316.510217495263
QFGSPBM///317.634631505236
!word - word : -1.12441400997341
-------K///28.3406251575798
Q///36.0052736476064
!word - word : -7.66464849002659
-
K///28.3406251575798
Q///36.0052736476064
!word - word : -7.66464849002659
-------KI///58.5020974781364
QI///65.8263162281364
!word - word : -7.32421875
-
IK///61.2012185193598
IQ///66.9981912281364
!word - word : -5.79697270877659
-------KJV///106.754390111193
QJV///114.078608861193
!word - word : -7.32421875
-
JVK///112.602925214916
JVQ///118.399897923693
!word - word : -5.79697270877659
-------KIHM///163.576022496447
QIHM///170.900241246447
!word - word : -7.32421875
-
IHMK///166.27514353767
IHMQ///172.072116246447
!word - word : -5.79697270877659
-------KJLSC///190.697940221056
QJLSC///198.022158971056
!word - word : -7.32421875
-
JLSCK///197.31551829353
JLSCQ///203.112491002306
!word - word : -5.79697270877659
-------KUFPTU///259.567904820666
QUFPTU///266.892123570666
!word - word : -7.32421875
-
UFPTUK///262.230404768139
UFPTUQ///268.027377476916
!word - word : -5.79697270877659
-------KOASMTI///293.428088536486
QOASMTI///300.752307286486
!word - word : -7.32421875
-
OASMTIK///299.726916661486
OASMTIQ///305.523889370263
!word - word : -5.79697270877659
-------*/
