【问题标题】:Applescript combining file pathsApplescript 组合文件路径
【发布时间】:2011-04-06 06:40:29
【问题描述】:

我正在使用带有 QuarkXpress 的 applescript,并希望将文件保存为 eps 格式。保存非常好,除了保存文件的位置。以下是相关代码:

set newFileName to "e.eps"
set newFilePath to "/Users/user123"
        save page 1 in (newFilePath & newFilePath) EPS format EPSFormat EPS data EPSData scale EPSScale without transparent page

这将文件保存在 QuarkXpress 应用程序文件夹中,名称为“/Users/user123/e.eps”。 我怎样才能避免这种情况?谢谢

【问题讨论】:

  • 你想把它保存在哪里?

标签: applescript posix filepath


【解决方案1】:

不幸的是,由于 AppleScript 起源于 Mac OS X 之前的日子,默认情况下它不使用 POSIX 路径。您可以使用 AppleScript 的本机格式 (Hard Drive Name:Users:user123:e.eps) 指定路径,也可以使用 (POSIX file "/Users/user123/") & "e.eps" 将 POSIX 路径转换为 ​​AppleScript 路径。

【讨论】:

    【解决方案2】:

    这取决于你想把它放在哪里。

    set dt to path to desktop
    set newFileName to "e.eps"
    set newFilePath to "" & dt & newFileName
    
    save page 1 in (newFilePath) EPS format EPSFormat EPS data EPSData scale EPSScale without transparent page
    

    也许是桌面?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-31
      • 2016-05-22
      • 1970-01-01
      • 1970-01-01
      • 2011-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多