【问题标题】:Illustrator Save Options and useing variable settingsIllustrator 保存选项和使用变量设置
【发布时间】:2013-10-29 04:28:37
【问题描述】:

开始使用 Illustrator 脚本并尝试编写允许我通过输入更改变量并影响保存设置的脚本。我要更改的保存选项如下:

-- Save and overwrite
save theCurrentFile in file WorkPath as Illustrator ¬
  with options {class:Illustrator save options ¬
  , compatibility:Illustrator 14 ¬
  , embed linked files:true ¬
  , font subset threshold:0.0}

我希望能够更改对变量的兼容性,但无论我将变量设置为什么,我都无法理解它。我追求的是这样的:

--Variable
set CompatibilityType to "Illustrator 14"

-- Save and overwrite
save theCurrentFile in file WorkPath as Illustrator ¬
  with options {class:Illustrator save options ¬
  , compatibility:CompatibilityType ¬
  , embed linked files:true ¬
  , font subset threshold:0.0}

我错过了什么,这不想工作。我在属性列表中做过类似的事情。

【问题讨论】:

    标签: variables applescript adobe-illustrator


    【解决方案1】:

    兼容性表示为 Illustrator 字典中定义的枚举,而不是字符串。您正在尝试使用 "Illustrator 14" 来表示兼容版本。你需要的是Illustrator 14。注意缺少引号。您可以使用以下子例程即时将字符串转换为枚举。当然,您可以根据需要更改字符串表示形式。这些只是我使用的。

    set CompatibilityType to my convertIllustratorVersion("CS4")
    
    save theCurrentFile in file WorkPath as Illustrator ¬
      with options {class:Illustrator save options ¬
      , compatibility:CompatibilityType ¬
      , embed linked files:true ¬
      , font subset threshold:0.0}
    
    on convertIllustratorVersion(originalVersion)
        using terms from application "Adobe Illustrator"
            set versions to {"CS", "CS2", "CS3", "CS4", "CS5"}
            set enums to {Illustrator 11, Illustrator 12, Illustrator 13, Illustrator 14, Illustrator 15}
        end using terms from
    
        repeat with i from 1 to (count versions)
            if originalVersion is item i of versions then
                return item i of enums
            end if
        end repeat
    
        error (quoted form of originalVersion & " is not a valid Illustrator version")
    end convertVersionNumber
    

    【讨论】:

      猜你喜欢
      • 2011-08-09
      • 2014-05-08
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多