How do you use the new "move inside" command?

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 do you use the new "move inside" command?

Postby RickDT » Sun Dec 03, 2017 8:42 pm

(I'm pretty new to AppleScript)
If I have a variant aVariant and a collection aCollection, how would I use the "move inside" command to move aVariant into aCollection? I've every syntax I can think of, but either either won't compile or I get the error "Some parameter is missing for move inside."

Things I've tried:
Code: Select all
tell aVariant to move inside of aCollection

Code: Select all
tell aVariant
  move inside of aCollection
end tell

Code: Select all
tell aCollection to move inside aVariant

Code: Select all
move aVariant inside of aCollection


Thanks!
Rick
RickDT
 
Posts: 2
Joined: Sun Jun 12, 2016 5:02 am

Re: How do you use the new "move inside" command?

Postby Jim_DK » Mon Dec 04, 2017 11:36 am

Hi

Can you post a more complete example? - it is hard to determine your issue without seeing how you are addressing the objects.
James
Phase One DK
Jim_DK
Crew
Crew
 
Posts: 628
Joined: Thu Dec 03, 2009 10:00 pm

Re: How do you use the new "move inside" command?

Postby RickDT » Mon Dec 04, 2017 3:23 pm

Sure thing, here's the simplest possible POC:

Code: Select all
tell application "Capture One 11"
   set aVar to variant 1 of collection 1 of current document
   set aCollection to collection 6 of current document -- 6 is a regular album I set up as a Test destination for moving variants
   log "" & name of aVar
   log "" & name of aCollection
   tell aVar to move inside of aCollection
end tell


When I run this code, I get
Code: Select all
Some parameter is missing for move inside.
. How should I be using that command?
RickDT
 
Posts: 2
Joined: Sun Jun 12, 2016 5:02 am

Re: How do you use the new "move inside" command?

Postby Jim_DK » Mon Dec 04, 2017 9:24 pm

Ok. I can see why this might be troublesome :) DIctionary explains some of the issues:

1. Move inside is for favorites and folders and is a physical file on disk move. So, If an album (as album is just references) you need to use "add inside" (adds instance)
2. Move inside expects a list, even in this case for a list of 1 - so put aVar in {}

Something like the below (in my example this is a session and moves files from the Capture folder to the 8th collection which happens to be a favorite) now works. Just another tip, when sending loads of messages to the same object (or its objects), it reads easier to wrap the code in question in another tell - you can wrap everything in a tell current document and then remove all the other references to current document.

Code: Select all
tell application "Capture One 11"
   tell current document
      set aVar to variant 1 of collection 1
      set aCollection to collection 8 -- 8 is a fav in my current document so works for this example.
      log "" & name of aVar
      log "" & name of aCollection
      move inside aCollection variants {aVar}
   end tell
end tell
James
Phase One DK
Jim_DK
Crew
Crew
 
Posts: 628
Joined: Thu Dec 03, 2009 10:00 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest