in

Quark Forums

Substitute Font Script and more

Last post 04-07-2009 12:40 PM by elpy zee. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-12-2008 10:27 AM

    Substitute Font Script and more

    Hi Emma, Smile))
    Hi Forum People, Smile))

    Let's get back to the script that was perfectly improved by Emma...Smile))

    tell application "QuarkXPress Passport"
    tell every story of document 1
    try
    set font of every text style range whose font is "Trade Gothic Lt Cn Eighteen" to "Arial Narrow Cyr MT"
    end try
    end tell
    end tell


    It works perfectly...
    I just wanted to know whether it is possible to improve it a little bit and...

    set (properties of every character of every story whose font is "Arial Narrow Cyr MT") to {size:7, scale:90}

    just by adding this line after ..set font... line it doesn't work... where I am wrong...?

    Thanks in advance
    Dmitry
  • 04-12-2008 8:24 PM In reply to

    • JRS
    • Top 25 Contributor
    • Joined on 05-29-2004
    • Colorado
    • Posts 653

    Substitute Font Script and more

    When I ran that, it set the size of the last matching text style range, but that was all, which had me pretty confused. But after looking at this more closely, I realized that "scale" is not a property of a text style range, only "horizontal scale" or "vertical scale". So I got expected results when I changed the command to

    set properties of every text style range whose font is "Times" to {size:7, horizontal scale:90}
  • 04-13-2008 10:40 AM In reply to

    Substitute Font Script and more

    Hi, Smile

    Thanks to Emma Smile and JRS Smile I currently have a perfect script that:
    ...replaces fonts on all the documents in source folder that may be chosen...
    For some fonts this script also derfines target parameters: in this case scale and size of characters...
    The script is below:
    tell application "Finder"
    choose folder with prompt "Choose the folder of Quark Documents to substitute fonts:"
    set vPath1 to result
    set vFilesList to every document file in result
    repeat with i in vFilesList
    tell application "QuarkXPress Passport"
    activate (open i)
    tell every story of document 1
    try
    set (font of every text style range whose font is "?") to "?"
    end try
    try
    set (properties of every text style range whose font is "?") to {font:"?", size:?, horizontal scale:?}
    end try
    end tell
    save document 1
    close document 1
    end tell
    end repeat
    end tell


    Thanks to the Forum, you can use the script...

    Regards
    Dmitry
  • 04-07-2009 7:54 AM In reply to

    • zbrntt
    • Not Ranked
    • Joined on 04-06-2009
    • Posts 8

    Re: Substitute Font Script and more

    Hi,

    I've never used AppleScript much but I found this script, ran it and I think it can save me about ten hours of work. Thank you!

    However, I get an error message when I run it:

    QuarkXpress Passport got an error: Some parameter wasn't understood.

    My script editor highlights the line

    save document 1

    at this point.

    Can anyone tell me why? Sorry if it's a basic question: I'm a total AppleScript newbie and just so tantalised by the idea of saving all those hours of work =)

    Thanks

    Zoe 

     

  • 04-07-2009 12:40 PM In reply to

    Re: Substitute Font Script and more

    Perhaps you could try and "comment out" the offending lines and see what happens.

    Put 2 hyphens at the beginning of a line to turn it into a comment (so Applescript won't try to process it). Try this with the lines:

    save document 1 (change to --save document 1)

    close document 1 change to --close document 1)

    If you try this, start with just one Quark file in the folder that you choose in the Choose Folder dialog box that comes up when the script first starts. If the script runs, the Quark file will be left open and unsaved, but perhaps with most of the work done as far as changing fonts goes.

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems