如何在photshop中制作多行字符串

时间:2018-07-03 11:17:22

标签: javascript photoshop

我正在制作一个Ps脚本,我需要像发票一样显示一个地址字符串,所以我试图将我拥有的不同字符串放在1字符串的不同行上。我可以分别更改每个字符串,但是更改一个字符串要短得多。

我写的是:

adressFull = name1 + "\
" + adressStreet + "\
" + adressCity +", " + adressCP + "\
" + adressCountry

我得到的只是一个单行字符串。

2 个答案:

答案 0 :(得分:0)

如果要换行,则必须添加“换行符”:Books,并确保在“选项”标签上将该字段设置为多行

Source

function twitter_auth_users($page){
    $connection = new TwitterOAuth('consumer_key', 'consumer_secret_key');
        $request_token = $connection->getRequestToken('https://www.example.com/socialconnect/twitter/connect/');
        $_SESSION['token']          = 'outh_token';
        $_SESSION['token_secret']   = 'outh_token_secret';
        $result['status'] = "login";
        $result['oauth_token'] = $request_token['oauth_token'];
        $result['loginUrl'] = $connection->getAuthorizeURL($request_token['oauth_token']);
        return $result;
    }

答案 1 :(得分:0)

对于textItem,您可以使用\r代替\n

myTextLayer = activeDocument.artLayers.add()
myTextLayer.kind = LayerKind.TEXT

var name1 = "toto"
var adressStreet = "42 code street"
var adressCity = "foo"
var adressCP = 42000
var adressCountry = "bar"

var adressFull = name1 + "\r" +
    adressStreet + "\r" +
    adressCity + ", " + adressCP + "\r" +
    adressCountry

myTextLayer.textItem.contents = adressFull

结果:

enter image description here