• 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: Lion versus regex
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lion versus regex


  • Subject: Re: Lion versus regex
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 15 Sep 2011 07:38:29 -0400

The command "change regex into replacement" is not part of standard AppleScript; it requires Smile (or Satimage.osax).  Do you have one of those installed on the Lion machine?

On Wed, Sep 14, 2011 at 8:38 PM, Robert Poland <email@hidden> wrote:
Hi,

This handler is failing for me in Lion. Has worked for ages with Snow Leopard.

The error <Expected end of line, etc. but found""".> occurs at the quote at the end here set mainMonitor to change " both occurrences.

Is there another way to accomplish this?

on getMonitorSize() -- Get monitor size and dimensions
set originalDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set screenData to do shell script "CScreen -L"
set mainMonitor to text item 1 of screenData -- get line 1
set mainMonitor to change "^[[:space:]]+" into "" in mainMonitor with regexp
-- remove leading space
set mainMonitor to change "[[:space:]]+" into " " in mainMonitor with regexp
-- change all multiple spaces into one space
set AppleScript's text item delimiters to space
set original_R to text item 3 of mainMonitor
set original_B to text item 4 of mainMonitor
set AppleScript's text item delimiters to originalDelimiters
end getMonitorSize

TIA,


Robert Poland - Fort Collins, CO




 _______________________________________________
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




--
Mark J. Reed <email@hidden>

 _______________________________________________
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: 
 >Lion versus regex (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Delivery Status Notification (Failure)
  • Next by Date: Re: Lion versus regex
  • Previous by thread: Re: Lion versus regex
  • Next by thread: Fwd: Lion versus regex
  • Index(es):
    • Date
    • Thread