Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Applescript 图像事件:相同的脚本在一台Mac上另存为RGB JPEG,在另一台Mac上另存为CMYK JPEG_Applescript_Image Events - Fatal编程技术网

Applescript 图像事件:相同的脚本在一台Mac上另存为RGB JPEG,在另一台Mac上另存为CMYK JPEG

Applescript 图像事件:相同的脚本在一台Mac上另存为RGB JPEG,在另一台Mac上另存为CMYK JPEG,applescript,image-events,Applescript,Image Events,以下是违规代码: 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 tel

以下是违规代码:

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)上,它将JPEG保存为RGB格式(所需的行为),而在另一个Mac(10.6.8)上,它将JPEG保存为CMYK格式,这显然是不需要的

是否有人知道10.6和10.7中的Image Events版本之间存在任何变通方法或差异?我也不确定,这只是一种暗中的试探


干杯

我不知道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不是有效的文件跳过。错误4:未指定任何文件
。有什么想法吗?该代码旨在添加到end tell和end repeat语句之间。在这一点上,大路径的内容是什么?啊,我明白了<代码>大路径为
将大路径设置为(大文件夹为字符串)&原始名称为字符串
Large\u文件夹
将Large\u文件夹设置为导出路径&“Large:”为字符串
original\u name
将original\u name设置为此索引的名称\u jpeg
此indd_jpeg
是使用
将indd_jpeg_列表设置为(名称以“页面”开头,名称以“.jpg”结尾的(导出路径为别名)的每个文件)生成的列表的成员。