Re: Periods in string after concatenating ?
Re: Periods in string after concatenating ?
- Subject: Re: Periods in string after concatenating ?
- From: "Nigel Garvey" <email@hidden>
- Date: Mon, 30 Aug 2010 20:55:50 +0100
Hernan wrote on Sun, 29 Aug 2010 19:35:02 -0400:
>Periods problem when dealing with Photoshop CS5.
>
>set name_file to the name of the current document as string
>
>set AppleScript's text item delimiters to "."
>set new_name to first text item of name_file as string
>
>display dialog new_name
># here works fine, I get the name as I need it
>
>set zoom_size to save_folder & ":1500:" & new_name & "_1_zoom.jpg" as string
>
>display dialog zoom_size
># here I get the name of the file between periods like this -->
>.new_name.
The periods aren't caused by the concatenation, but by the coercion to
string which follows it. It's probable that the value of 'save_folder'
is an alias, which would make the result of the concatenation a list.
It's the coercion of this list to text, with the text item delimiters
set to ".", which causes a period to appear between each component of
the result.
As well as what David and Shane have told you, you could put the 'as
string' immediately after 'save_folder' instead of at the end of the
line. This would give you a string concatenation throughout, which
wouldn't be affected by the current value of the TIDs:
set zoom_size to (save_folder as string) & ":1500:" & new_name &
"_1_zoom.jpg"
You may need to drop the leading colon from ":1500:".
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden