how to set camera attributes

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

how to set camera attributes

Postby NNN636227795015102689 » Mon Jan 27, 2020 4:55 pm

I'm new to apple script (not to programming in general) and try to build a little script which captures a sequence of images with different exposures (or other settings).
I simply do not understand the documentation on "camera" or "attributes" or the syntax how they can be modified with apple script. This is a the script so far with the attribute line missing...

Code: Select all
tell application "Capture One 20"

   ## set attribute "ISO" to 400      <--  how to do this??

   capture
   delay 5
   ## change camera setting, take next picture ...    
end tell


It would be great if someone could be so helpful to point me in the right direction or fill in the missing code line. I've searched the net for examples or tutorials but no luck yet.

Best regards,
Volker Kunkel
NNN636227795015102689
 
Posts: 2
Joined: Wed Feb 15, 2017 7:18 pm

Re: how to set camera attributes

Postby emorydunn » Mon Jan 27, 2020 7:09 pm

AppleScript has a really bizarre syntax and can be difficult to learn if you already know some "real" programming.

You should be able to set the attributes like this:

Code: Select all
tell application "Capture One 12.0"
   
   set theCamera to camera of current document

   set ISO of theCamera to "400"
   
   capture
   delay 5
   ## change camera setting, take next picture ...   
end tell
User avatar
emorydunn
 
Posts: 31
Joined: Fri Jun 14, 2013 7:36 am
Location: San Francisco, California

Re: how to set camera attributes

Postby Eric Nepean » Fri Jan 31, 2020 4:12 pm

Applescript is an object oriented language.

Many of the new software languages since 1990 are object oriented; to use them effectively you need understand and consider objects.

For example lets look at the idea of a a "name". The document has a name. Every album in the document has a name. Every variant and every image has a name. Other things can have names. Some things do not have names.

How does a programmer find, or change the name of one of these things? Each of these things are objects. There are different types of objects, Document, Collection, Image, Variant, Camera, Browser, Viewer etc.

There maybe one or many or none of a type of object.

E.G.To get the name of the document which is now open, we have to state which document we refer to.

The following ways all work
Code: Select all
get name of current document
get name of first document
get name of document 1
get document 1's name


To get or change ISO information about a camera, we need to realise that Capture one considers the camera to be part of the document, and it assumes there is only one camera.

The following code should work (I don't have a tethered camera)

Code: Select all
get ISO of camera of document 1
get ISO of camera of (get current document)

set theDoc to get current document
get ISO of theDoc's camera

set theCamera to camera of current document
get theCamera's ISO


Unfortunately Apples' Script Editor is a poor tool for writing Applescripts, especially for the beginner; information about objects is difficult to get and poorly presented.

Late Nite Software has a tool called Script Debugger, which is much better; there is a lite version which is free (download the trial and keep running it after the trial expires)

Script Debugger has a window which shows all the objects of some software like Capture One, how the objects are related to each other, what kind of properties each object has, and what the current value of each property is. This make work much easier, especially for the beginning programmer.
Eric Nepean
 
Posts: 678
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: how to set camera attributes

Postby NNN636227795015102689 » Sun Feb 02, 2020 6:49 pm

Thank you guys. That was really helpful and works like a charme!
NNN636227795015102689
 
Posts: 2
Joined: Wed Feb 15, 2017 7:18 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 2 guests