Thursday, March 30, 2017

#1 2015-11-19 11:32:15 am

sranta
Member
Registered: 2015-11-19
Posts: 3

Moving files, location specifier error

Hello everyone, my first post.

I want to move an image file to Capture One’s own session Trash folder. I can get the path to Trash but my script stops with Applescript message:

Error -1700 occurred: Can’t make file ”HD:Path:to:Session:Trash:” into type location specifier.

What is the right way to give the path to Trash?

Applescript:

tell application "Capture One"
   set pathToTrash to (get trash of document 1)
   set selectedImage to (get parent image of (get item 1 of (get selected variants)))
   move (id of selectedImage) to pathToTrash -- fails
end tell

Thanks,
Sam


Filed under: location, Capture One

Offline

 

#2 2017-03-04 08:04:49 am

rapdigital
Member
Registered: 2007-06-28
Posts: 59

Re: Moving files, location specifier error

Just saw you post

Applescript:

tell application "Capture One 9"
   set pathToTrash to (get trash of document 1)
   set selectedImage to (get id of parent image of (get item 1 of (get selected variants)))
   do shell script "mv" & " -f " & quoted form of selectedImage & space & quoted form of POSIX path of pathToTrash
end tell

does the job

Offline

 

#3 2017-03-04 11:55:15 am

sranta
Member
Registered: 2015-11-19
Posts: 3

Re: Moving files, location specifier error

Thanks for the code! I'll try it  :-)
Do you know how to move the image with Capture One (so that also the associated settings files would follow)?

Sam

Offline

 

#4 2017-03-04 02:29:43 pm

rapdigital
Member
Registered: 2007-06-28
Posts: 59

Re: Moving files, location specifier error

No and I'm not sure that Capture One can do it via applescript ateast in v9, v10 might be able to. Its reasonably straightforward to move the settings files with a couple more shell calls.

Offline

 

#5 2017-03-13 03:50:35 pm

sranta
Member
Registered: 2015-11-19
Posts: 3

Re: Moving files, location specifier error

Capture One 9 has move in dictionary:

move v : Move an object to a new location.
move specifier : The object(s) to move.
to location specifier : The new location for the object(s).

If I change your do shell script line to:

Applescript:

   move selectedImage to pathToTrash -- fails

...I get now the error:

Error -1700 occured:
Can’t make "/HD/Path/to/Session/Capture/img 3944.IIQ" into type specifier.

This time the path is unix-style. What might be the right syntax for the object and location specifiers?

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.031 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)