• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting the minus sign in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting the minus sign in a string


  • Subject: Re: Detecting the minus sign in a string
  • From: Tommy Bollman <email@hidden>
  • Date: Thu, 24 Jun 2010 10:08:26 +0200

This code runs.

set appName to application "AppleScript Editor"
tell application "Finder" to tell appName to get id of window 2

It must be a bug or have something to do with the fact that System Events supports the process class and other apps do not.


On 23. juni 2010, at 21.22, Michelle Steiner wrote:

> On Jun 23, 2010, at 11:36 AM, Alex Zavatone wrote:
>
>> Well, specifically, I'm trying to see if the minus sign is the second word from the end of a string.
>
> that makes it easy, assuming that there's at least one hyphen in the string.
>
> set text item delimiters to {"-"}
> set mystring to "This is - my - string"
> if (count words of last text item of mystring) is 1 then
> 	true
> else
> 	false
> end if
>
> This returns true if the last of more than one hyphens is the last word of the string.
>
> You would need error correction for zero hyphens.  There may, however, be a problem depending on how you are defining "word"; would any other non-alphanumeric be considered a word, or exist after the last hyphen?
>
> -- Michelle
>
> --
> "Life is too cool to miss."
> -- Sammy Camarata
>
> _______________________________________________
> 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

Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
	If an idea can survive a bureaucratic review
	and be implemented it wasn't worth doing.

 _______________________________________________
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

References: 
 >Detecting the minus sign in a string (From: Alex Zavatone <email@hidden>)
 >Re: Detecting the minus sign in a string (From: Michelle Steiner <email@hidden>)
 >Re: Detecting the minus sign in a string (From: Alex Zavatone <email@hidden>)
 >Re: Detecting the minus sign in a string (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: System Events: window id's instead of window names?
  • Next by Date: Re: application and application (was: System Events: window id's instead of window names?)
  • Previous by thread: Re: Detecting the minus sign in a string
  • Next by thread: Re: Detecting the minus sign in a string
  • Index(es):
    • Date
    • Thread