• 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: ScriptingAddition for camelcase (solved)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ScriptingAddition for camelcase (solved)


  • Subject: Re: ScriptingAddition for camelcase (solved)
  • From: Ronald Hofmann <email@hidden>
  • Date: Tue, 17 Jan 2012 05:33:21 +0100

yes of course, something similar I´ve stated completely before were this is called in myLibrary.

set myLib to load script file (((path to "cusr" from user domain) & "DEV:LibPool:myLibrary.scpt") as text)

tell application "TextWrangler"
set theTextToChng to selection as text #of window 1 #- insert actions here
set theTextToChng to myLib's changeCase(theTextToChng, "hilo")
set selection to theTextToChng
end tell

(* Inside myLibrary *)
on changeCase(theText, action)


if action = "hi" then
set cmd to "echo " & quoted form of theText & " | tr \"[:lower:]\" \"[:upper:]\""

else if action = "lo" then
set cmd to "echo " & quoted form of theText & " | tr \"[:upper:]\" \"[:lower:]\""

else if action = "hilo" then
set cmd to "PHP -r 'echo ucwords(strtolower(\"" & theText & "\n\"));'"

end if


return (do shell script cmd)


end changeCase

 _______________________________________________
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: 
 >ScriptingAddition for camelcase (From: Ronald Hofmann <email@hidden>)
 >Re: ScriptingAddition for camelcase (From: BareFeetWare <email@hidden>)
 >Re: ScriptingAddition for camelcase (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Fwd: ScriptingAddition for camelcase (solved via PHP)
  • Next by Date: Re: ScriptingAddition for camelcase
  • Previous by thread: Re: ScriptingAddition for camelcase
  • Next by thread: Re: ScriptingAddition for camelcase (solved via PHP)
  • Index(es):
    • Date
    • Thread