• 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 23:21:02 +1100

On 28/01/2012, at 10:57 PM, Shane Stanley wrote:

you really *do* have to add additional software

Let me qualify that once again... You can also do it without additional software, provided you're using 10.6 or later. In AppleScript Editor in 10.7, choose File -> New from Template -> Cocoa-AppleScript Applet.app, and paste in this:

on run
set x to the clipboard
tell current application's NSString to set x to stringWithString_(x)
set x to x's stringByReplacingOccurrencesOfString_withString_(":", "")
set the clipboard to x's uppercaseString() as text
tell me to quit
end run

Save, and double-click on the app. The catch is that you have to use it in an app; you can't use it in a script run from a script menu, or even directly within ASE. (That's what an external app like ASObjC Runner provides.) And you can't debug it in ASE.

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

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>)
 >Re: Reformatting a string (From: KOENIG Yvan <email@hidden>)
 >Re: Reformatting a string (From: Shane Stanley <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