script command to end text line

script command to end text line

Anonymous
Not applicable
4,090 Views
7 Replies
Message 1 of 8

script command to end text line

Anonymous
Not applicable

I have the below script where the layer description does not return at the space after the description (ie General_Text) to select the layer (ie A-TEXT). What is the syntext I need to make this work? Also the script ends still in the layer command. How can I end at standard prompt?

 

-LAYER
N A-TEXT C 4 A-TEXT LT continuous A-TEXT D General_Text A-TEXT
N A-ANNO-SYMB C 4 A-ANNO-SYMB LT continuous A-ANNO-SYMB D Symbols A-ANNO-SYMB

0 Likes
Accepted solutions (1)
4,091 Views
7 Replies
Replies (7)
Message 2 of 8

gdefilo
Advocate
Advocate

Hi dbarringer,

 

try putting a <return> after every string.

 

Attaching the script that works for me. You have to rename it, quitting ".zip".

 

Hope this helps,

Giancarlo

 

0 Likes
Message 3 of 8

pendean
Community Legend
Community Legend
It's hard to see <enter> when you have only blank spaces, so as noted above add another.

It's easiest to write a script code if instead of spaces you used a hard return like you started to then quit, makes extra <enter> appear as a blank line and it's easiest to simply look at it and tell what's going on.
COMMAND
SUBOPTION
SUBOPTION
(<<<<blank line means extra <enter>)
ANOTHERCOMMAND
SUBOPTION

(and so on)
0 Likes
Message 4 of 8

Anonymous
Not applicable

Thanks for your reply. I would like to keep the code for a layer all on one line because I am extracting it from an excel file that has all the layers, colors, line types and descriptions. The last excel cell then creates the code that goes into the script. Is there a way to have the script recognize a return without doing a hard return?

0 Likes
Message 5 of 8

Anonymous
Not applicable

The zip downloaded with an error. could you reattach.

0 Likes
Message 6 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

The zip downloaded with an error. could you reattach.


It's not really a .zip file.  They just changed the filetype ending to .zip to be allowed to attach it [I don't think that's necessary with a .txt file as with certain other file types, but it may vary with operating system and browser].  If you right-click on it, choose Save As, and change the .zip ending to .txt in Saving it, you should be able to open it.

Kent Cooper, AIA
0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... I would like to keep the code for a layer all on one line .... Is there a way to have the script recognize a return without doing a hard return?


For the end of the line, try just using two spaces at the end [the second to complete the Layer command].  It has the disadvantage [already mentioned] that you can't see that there are two spaces, but if the Layer names work ended with spaces in the other options, then it's not going to read the spaces as part of the Layer name [I believe if you want to use Layer names with spaces in a Script, you need to surround them with double-quotes], so it ought to at least work.

 

However, I haven't used Descriptions enough [and in this kind of situation not at all] to know whether it will accept a description with spaces regardless.  If so, that's your problem -- the Layer name is being read as a continuation of the Description.  You could try putting the Description part inside double-quotes -- maybe after that, the following space won't be considered part of it, and it will move on to accept the name of the Layer you want that Description assigned to.  But it may be necessary to start that Layer name immediately after the closing double-quote, without a space between them.

Kent Cooper, AIA
0 Likes
Message 8 of 8

Anonymous
Not applicable
Accepted solution

Found the solution. Adding \U+000D after description and then the layer name in "" works.

 

 

-LAYER
N A-TEXT LT continuous A-TEXT LW 0.35 A-TEXT C 4 A-TEXT D General Text\U+000D"A-TEXT"
N A-ANNO-SYMB LT continuous A-ANNO-SYMB LW 0.35 A-ANNO-SYMB C 4 A-ANNO-SYMB D MARVY Symbols\U+000D"A-ANNO-SYMB"