Copy link to clipboard
Copied
Hi EveryOne,
I am using the below line in my script,
myFrame = myDoc.pages[1].textFrames.add({strokeWeight:"0pt"});
It is creating a text frame, but with 1pt stroke weight. While i'm checking in the data browser it says "The property is not applicable in the current state".
But when I alert the (myFrame.strokeWeight) it alerts with the correct value.
My Work Around: (Still it is Bad)
Then I changed the code
myFrame = myDoc.pages[1].textFrames.add({strokeWeight:"0pt"});
myFrame.strokeWeight = 0;
Then it works for me. The problem is I have to give the stroke values in two places, If I remove any one of them, then my code is not working properly.
Please help me to overcome this issue....
----
Green4ever
Copy link to clipboard
Copied
Green:
The Data Browser is not reliably. In particular, if you have not accessed myFrame's properties, The ESTK does not have access to the DOM object details unless you access some properties of myFrame. So this behavior of the data browser is not surprising, and I am not sure that it is releant to your problem.
What happens if you use "0" rather than "0pt"? Or, for that matter, 0 (not a string)? Or the strings "0p0" or "p0"?
Copy link to clipboard
Copied
Hi John,
What happens if you use "0" rather than "0pt"? Or, for that matter, 0 (not a string)? Or the strings "0p0" or "p0"?
Note: I have set the preferences to pt
I've tried using both string representation "0" and "0pt" and also tried 0 (not a string). None of them is not worked for me...
---
Green4ever
Copy link to clipboard
Copied
Hi Green4ever,
[Sorry, it's not the right code. I can't test now]
I guess that {strokeColor:'none'} supersedes {strokeWeight:0}. Try this:
myFrame = myDoc.pages[1].textFrames.add({strokeColor:'None'});
@+
Marc
Copy link to clipboard
Copied
Hi Marc Autret,
May be You are right....
myFrame = myDoc.pages[1].textFrames.add({strokeColor:"None",strokeWeight:0});
This Code worked for me...
---
Green4ever
Copy link to clipboard
Copied
But with Marc's code:
myFrame = myDoc.pages[1].textFrames.add({strokeColor:"None",strokeWeight:0})
the stroke weight is still the standard 1 pt (or whatever it is). For Marc's solution to work well, you should set the stroke weight to 0.00000001 pts, which is as thin as you can get it.
Peter
Copy link to clipboard
Copied
Hi Peter and Laubender,
the stroke weight is still the standard 1 pt (or whatever it is). For Marc's solution to work well, you should set the stroke weight to 0.00000001 pts, which is as thin as you can get it.
If you give stroke color and stroke weight together it works fine.
As Marc Autret said, beacuse of stroke color value it takes a deafult strokeweight value. (I think this may be a cause)....
I guess that {strokeColor:'none'} supersedes {strokeWeight:0}.
Thanks,
Green4ever
Copy link to clipboard
Copied
Green4ever:
Use strokeColor and strokeWeight together.
myFrame = myDoc.pages[1].textFrames.add({
strokeColor:"None",
strokeWeight:0
});
I think your problem stems from the default object style [Basic Text Frame] automatically applied to every new text frame. So check the properties there.
Uwe
Copy link to clipboard
Copied
Hi Laubender,
The default object style [Basic Text Frame]'s stroke weight is set to zero. Eventhough your sugestion worked for me. Thank U....
-Green4ever
Copy link to clipboard
Copied
Hi Green4ever,
If it's not [Basic Text Frame], I wonder why that will happen…
Do you have an idea?
Uwe
Copy link to clipboard
Copied
I had the same problem.
Try this:
app.documents.item(0).pageItemDefaults.strokeWeight=0;
And check that you do not have a default objectstyle with strokeWeight 0
Ralf
Copy link to clipboard
Copied
Hi liedzeit,
I tried your suggestion it didnot work.
And check that you do not have a default objectstyle with strokeWeight 0
Yeah I checked in the default object style stroke weight is set to zero.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now