Re: Running script from shortcuts v editor?
Re: Running script from shortcuts v editor?
- Subject: Re: Running script from shortcuts v editor?
- From: Shane Stanley <email@hidden>
- Date: Mon, 28 Jan 2013 09:11:43 +1100
On 28/01/2013, at 4:35 AM, Peter R Hawkes <email@hidden> wrote:
> set theText to characters 1 thru -(x + 1) of theText as text
What you're doing here is making a list of characters, and then coercing the list to a string. That's not only inefficient, but the result also depends on the value of AppleScript's text item delimiters at the time -- it looks like they were set to "=" when you ran the script in Fastscripts.
You can either keep digging and set the the delimiters to {""}, or do it more efficiently:
set theText to text 1 thru -(x + 1) of theText
Even then, your code will fail (try rstripString("abcd] ", "]")), because it should be either:
set theText to text 1 thru (x - 1) of theText
Or more simply, without the need to get the length of the string:
set theText to text 1 thru -2 of theText
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
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