Re: Replace all caps into plain
Re: Replace all caps into plain
- Subject: Re: Replace all caps into plain
- From: Jan Bultereys <email@hidden>
- Date: Thu, 28 Dec 2006 12:05:14 +0100
- Thread-topic: Replace all caps into plain
Hey Hans, thanks for your feedback and alternative proposal, but I think to
cover the "italic" story, it is almost impossible to describe all the
possibilities...
Your example covers 1 font, not even the complete family... This means to my
opinion a very, very big script to cover all font and families....
Anyway thanks very much for your time on this issue.
jan
> From: Hans Haesler <email@hidden>
> Date: Thu, 28 Dec 2006 11:41:32 +0100
> To: <email@hidden>
> Subject: Re: Replace all caps into plain
>
> On Wed, 27 Dec 2006, Jan Bultereys wrote:
>
>> About the italics that would be a case where the 'user' could cancel the
>> search... Since it has to be replaced by a 'real' italic font.
>
> Well... I still think it would be better to include
> the replacement of the fonts (italic and small caps)
> in the script. There is no need for selecting the text
> and showing a dialog.
>
> Here is a script which replaces the fonts, changes the
> styles and replaces 'all caps' with upper case (with a
> simplified command :-).
>
> I'm using the 'do script' method to speed up execution
> (24 short stories of 28 characters, 72 text style ranges:
> handler = 39.7 seconds | do script = 2.6 seconds).
> But, when run from the Scripts Menu, there is almost no
> difference: 2.553 seconds | 2.487 seconds.
> ---
> tell application "QuarkXPress Passport"
> activate
> set selection to null
> do script {changeFont}
> display dialog "Done." buttons "OK" default button 1 with icon 1
> end tell
>
> script changeFont
> tell document 1 of application "QuarkXPress Passport"
> repeat with s from 1 to (count of stories)
> tell story s
> repeat with i from (count of text style ranges) to 1 by -1
> tell text style range i
> if font is "LTSyntaxSerif Rg" and on styles of (get style) is {italic}
> then
> set font to "LTSyntaxSerif It"
> set objRef to object reference
> my setPlain(objRef)
> else if font is "LTSyntaxSerif Rg" and on styles of (get style) is
> {italic, all caps} then
> set font to "LTSyntaxSerif It"
> set objRef to object reference
> my setUC(objRef)
> else if font is "LTSyntaxSerif Rg" and on styles of (get style) is
> {small caps} then
> set font to "LTSyntaxSerif SC Rg"
> set objRef to object reference
> my setPlain(objRef)
> else if font is "LTSyntaxSerif Rg" and on styles of (get style) is
> {italic, small caps} then
> set font to "LTSyntaxSerif SC It"
> set objRef to object reference
> my setPlain(objRef)
> else if on styles of (get style) is {all caps} then
> set objRef to object reference
> my setUC(objRef)
> end if
> end tell
> end repeat
> end tell
> end repeat
> end tell
> end script
>
> on setPlain(objRef)
> tell application "QuarkXPress Passport"
> tell objRef
> set style to plain
> end tell
> end tell
> end setPlain
>
> on setUC(objRef)
> tell application "QuarkXPress Passport"
> tell objRef
> set style to plain
> set contents to uppercase (it as string)
> end tell
> end tell
> end setUC
> ---
>
> Regards,
> Hans
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> edepot.com
> Archives: http://lists.apple.com/mailman//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/mailman//archives/applescript-users
This email sent to email@hidden