You are not logged in.
Hey guys
A while a go I wrote an applescript that did a lot of useful operations for me.
A part of it was to create a string that contained some "\n" like for QR CODE generation in InDesign.
Applescript:
Somestring\nSomeotherString\nThirdString
As you cannot write \n in applescript - it causes libebreaks inside the script,-I used some characters instead of the ,\n' s like "#$%" and had a bash script replace them with "\n". Now I was wondering if there's a better method with object c to get a string that contains multiple "\n"
Offline
You can use:
Applescript:
"Somestring" & linefeed &"SomeotherString" & linefeed &"ThirdString"
Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com
Online
I tried that before. It doesn't work for my purpose. It has to be "\n" as text and line feed doesn't print that it just makes a newline.
Offline
If you want to print \n you use \\n.
Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com
Online
And this is where the problems start
I tried that also.
I need to write a line like this in a file with a batch command (not the AS 'write to file')
"String\nOtherString\nThirdString"
If I escape \\n it writes exactly that to file...
"String\\nOtherString\\nThirdString"
Which is wrong...
My thoughts were more like having an NSARRAY {String,Other string,..} an join it somehow with \n as separator
Offline
Can you show us your code/
It sounds like you should be using what I suggested originally, but quoting it.
Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com
Online
Erm... it works with the escape. Dunno why it didn't when I tried first. Close!
Offline