• 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: Reformatting a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reformatting a string


  • Subject: Re: Reformatting a string
  • From: Shane Stanley <email@hidden>
  • Date: Sat, 28 Jan 2012 09:42:45 +1100

On 28/01/2012, at 8:02 AM, KOENIG Yvan wrote:

Just that when I don't know the exact contents of strings to treat, I choose the code supposed to be able to treat every case.
Old habit of an inhabitant of a country using several non ASCII characters.

A good thing too. 

In the interests of variety, speed and, dare I prompt an argument, legibility, here's another version:

script capNStuff
set x to current application's NSApp's convertedValue()
set x to x's componentsSeparatedByString_(":")
set x to x's componentsJoinedByString_("")
set x to x's uppercaseString()
end script

set the clipboard to "a2:fh:2f:vv:i1:q1:For:Yvan:KÅ’NIG"
tell application "ASObjC Runner" to set the clipboard to (run the script {capNStuff} converting (get the clipboard as text) with result returned)

-- 
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

  • Follow-Ups:
    • Re: Reformatting a string
      • From: Thomas Fischer <email@hidden>
References: 
 >Reformatting a string (From: Angelo <email@hidden>)
 >Re: Reformatting a string (From: Michelle Steiner <email@hidden>)
 >Re: Reformatting a string (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Reformatting a string
  • Next by Date: Re: Reformatting a string
  • Previous by thread: Re: Reformatting a string
  • Next by thread: Re: Reformatting a string
  • Index(es):
    • Date
    • Thread