【问题标题】:Image events: identical script saves as an RGB JPEG on one Mac, CMYK JPEG on another图像事件:相同的脚本在一台 Mac 上另存为 RGB JPEG,在另一台 Mac 上另存为 CMYK JPEG
【发布时间】:2012-12-03 23:54:18
【问题描述】:

这是有问题的代码:

repeat with this_indd_jpeg in indd_jpeg_list
  set original_name to name of this_indd_jpeg
  set the_small_path to export_path & original_name as string
  set the_large_path to (Large_Folder as string) & original_name as string
  tell application "Image Events"
    launch
    set this_image to open (this_indd_jpeg as alias)
    scale this_image to size target_length_large
    save this_image as JPEG in file the_large_path with icon
    scale this_image to size target_length_small
    save this_image as JPEG in file the_small_path with icon
    close this_image
  end tell              
end repeat

问题是,在一台 Mac (10.7.5) 上,它以 RGB 格式保存 JPEG(所需的行为),而在另一台 (10.6.8) 上,它以 CMYK 格式保存它们,这绝对是不受欢迎的。

是否有人知道 10.6 和 10.7 中的图像事件版本之间的任何变通方法或差异?我不确定:这只是在黑暗中刺伤。

干杯!

【问题讨论】:

    标签: applescript image-events


    【解决方案1】:

    我不知道 10.7.5 和 10.6.8 之间图像事件的区别。但是你可以尝试用 sips 改变颜色空间:

    set theImage to quoted form of POSIX path of (the_large_path)
    do shell script "/usr/bin/sips -m '/System/Library/ColorSync/Profiles/Generic RGB Profile.icc' " & " " & theImage
    

    【讨论】:

    • 到处都是错误。最常出现的是page1.jpg not a valid file - skipping. Error 4: no file was specified。有什么想法吗?
    • 该代码旨在添加在 end tell 和 end repeat 语句之间。此时 the_large_path 的内容是什么?
    • 啊,我明白了。 the_large_pathset the_large_path to (Large_Folder as string) & original_name as stringLarge_Folderset Large_Folder to export_path & "Large:" as stringoriginal_nameset original_name to name of this_indd_jpegthis_indd_jpeg 是使用 set indd_jpeg_list to (every file of (export_path as alias) whose name begins with "page" and name ends with ".jpg") 生成的列表的成员。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 1970-01-01
    • 1970-01-01
    • 2017-02-26
    • 1970-01-01
    相关资源
    最近更新 更多