Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.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
Python appscript错误:OSERROR:-1700,Can';t将某些数据转换为预期类型_Python_Py Appscript_Sourceforge Appscript - Fatal编程技术网

Python appscript错误:OSERROR:-1700,Can';t将某些数据转换为预期类型

Python appscript错误:OSERROR:-1700,Can';t将某些数据转换为预期类型,python,py-appscript,sourceforge-appscript,Python,Py Appscript,Sourceforge Appscript,给出: from appscript import * ps = app("Adobe Photoshop CS5") s = ps.current_document.save s._labelledargterms 我没有完全使用kfil的意思。有人能解释一下吗 我试图做到以下几点: {'appending': 'DcXt', 'as_': 'fltp', 'copying': 'SaCp', 'in_': 'kfil', 'with_options': 'FmOp'} 这给了我:

给出:

from appscript import *
ps = app("Adobe Photoshop CS5")
s = ps.current_document.save
s._labelledargterms
我没有完全使用
kfil
的意思。有人能解释一下吗

我试图做到以下几点:

{'appending': 'DcXt',
 'as_': 'fltp',
 'copying': 'SaCp',
 'in_': 'kfil',
 'with_options': 'FmOp'}
这给了我:

import mactypes
f = mactypes.File("foo.jpg")
s(as_=k.JPEG, in_=f)

好的,看来我必须避免使用
mactypes.File
。奇怪的是,这是有效的:

CommandError: Command failed:
        OSERROR: -1700
        MESSAGE: Can't make some data into the expected type.
        COMMAND: app(u'/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app').current_document.save(in_=mactypes.File(u'/Users/az/foo.jpg'), as_=k.JPEG)
我不完全理解为什么会这样(而不是问题中的另一种方式),所以如果有人能进一步解释,那就太好了

s(in_="/Users/az/foo.jpg", as_=k.JPEG,
  with_options={k.class_:k.JPEG_save_options, k.quality:12},
  copying=True, appending=k.no_extension)