• 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: All Caps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: All Caps


  • Subject: Re: All Caps
  • From: David Bradley <email@hidden>
  • Date: Mon, 8 Oct 2007 10:41:04 +0100

Thanks for all your help and quick responses. I have successfully made my text Uppercase.

Another quick question, hopefully:

Baseline Shift - I think I've got the correct syntax, but it keeps giving me errors. Here's the syntax I'm using:

tell text box ("Region Name")
	set bounds to {-5.668, 12, 12.472, 71.459}
	set baseline to -2.64
	set vertical justification to bottom justified
end tell

Cheers

David Bradley
Senior Web Programmer
Globe Media
Brookfields Way
Manvers
Wath-upon-Dearne
Rotherham
S63 5DL

Tel: 01709 768231
Fax: 01709 768011
email@hidden
www.globe-media.com


On 8 Oct 2007, at 10:32, Michael Ghilissen wrote:

David,

From Applescript essential sub-routines ( available at http:// www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.07.htm )

Changing Case

The following sub-routine will change the case of alpha characters of passed text to either all lower or all caps. The sub-routine has two passed parameters:

1) the passed text to alter, 2) a case indicator

A case indicator of 0 will have the routine convert the passed text to lower case.

change_case("AppleScript", 0)
	--> "applescript"

A case indicator of 1 will have the routine convert the passed text to all caps.
change_case("AppleScript", 1)
--> "APPLESCRIPT"


---

on change_case(this_text, this_case)
if this_case is 0 then
set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set the source_string to "abcdefghijklmnopqrstuvwxyz"
else
set the comparison_string to "abcdefghijklmnopqrstuvwxyz"
set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
end if
set the new_text to ""
repeat with this_char in this_text
set x to the offset of this_char in the comparison_string
if x is not 0 then
set the new_text to ¬
(the new_text & character x of the source_string) as string
else
set the new_text to (the new_text & this_char) as string
end if
end repeat
return the new_text
end change_case

---

HTH

Michael Ghilissen


On Oct 8, 2007, at 5:04 AM, David Bradley wrote:

Hi,

Been have a search on google but no luck.

Just wondering what the syntax is in applescript for making text 'all caps'

Cheers

David Bradley
Senior Web Programmer
Globe Media
Brookfields Way
Manvers
Wath-upon-Dearne
Rotherham
S63 5DL

Tel: 01709 768231
Fax: 01709 768011
email@hidden
www.globe-media.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
@hotmail.com
Archives: http://lists.apple.com/archives/applescript-users


This email sent to 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
  • Follow-Ups:
    • Re: All Caps
      • From: Nick Hearn <email@hidden>
    • Re: All Caps
      • From: Rob Stott <email@hidden>
References: 
 >All Caps (From: David Bradley <email@hidden>)
 >Re: All Caps (From: Michael Ghilissen <email@hidden>)

  • Prev by Date: Re: All Caps
  • Next by Date: Re: All Caps
  • Previous by thread: Re: All Caps
  • Next by thread: Re: All Caps
  • Index(es):
    • Date
    • Thread