Re: Handler does not accept space in textstring
Re: Handler does not accept space in textstring
- Subject: Re: Handler does not accept space in textstring
- From: Stan Cleveland <email@hidden>
- Date: Wed, 05 Mar 2014 16:13:39 -0800
On Mar 5, 2014, at 3:56 PM, Iurista GmbH wrote:
> When the variable val contains a space (" ", like above in "Applications:other Software:"), the script calling the handler returns an error.
Hi Rudolf,
One of the simplest fixes would be to 'escape' the spaces, which is standard procedure for shell commands. In "Terminal" the escape character is a backslash (\).
However, because the backslash itself is reserved in AppleScript, it must also be escaped. So you'd need to add two backslashes before every space in the contents of your variable, 'val', something like this:
set val to "Applications:other\\ Software:"
There are several ways to add backslashes, but my suggestion is to use 'text item delimiters'. If you're not familiar with that, google it or look in the archives of this list.
HTH,
Stan C.
_______________________________________________
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