Article View: adobe.photoshop.scripting
Article #1889Re: Auto pasting of a filename onto a layer in PS7/CS
From: Larry_Ligon
Date: Wed, 21 Jul 2004 18:18
Date: Wed, 21 Jul 2004 18:18
13 lines
1376 bytes
1376 bytes
Here's how to do it in JavaScript:
var strFileName;
strFileName = "Donna Karan_125.jpg";
var strFileNameArray = strFileName.split('_');
alert ("First element is " + strFileNameArray[0]);
alert ("Second elememt is " + strFileNameArray[1]);
If strFileName is a string with the underscore character, then strFileNameArray will be an array containing 2 strings. The first
element of the array will contain the string before the underscore and the second element will contain the string after the
underscore.
Larry
Technical Details
Message-ID:
<4BC0ED3BADD2174AF79779516081F003@in.webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<3bb4f458.-1@webx.la2eafNXanI> <3bb4f458.2@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,1a13a1daed981d92 X-Google-Attributes: gidf5839,public X-Google-Language: ENGLISH,ASCII-7-bit From: Larry_Ligon@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.photoshop.scripting Subject: Re: Auto pasting of a filename onto a layer in PS7/CS Message-ID: <4BC0ED3BADD2174AF79779516081F003@in.webx.la2eafNXanI> Date: Wed, 21 Jul 2004 11:18:12 -0700 References: <3bb4f458.-1@webx.la2eafNXanI> <3bb4f458.2@webx.la2eafNXanI> Lines: 15 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit