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: 636
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: 636
Joined: Thu Dec 03, 2009 10:00 pm

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

Postby rapdigital » Fri Aug 31, 2018 5:27 am

How do I set a posix path as the destination? Or does it need to be a collection first?
*this is taken from a much larger script so might not make sense?? :)

Code: Select all
tell application "Capture One 11"
   set SessionPath to folder of current document as string
set SkuFolderName to "SkuFolderName"
   tell current document
      set aVar to variant 1 of collection 1
      set newFolder to quoted form of (POSIX path of (SessionPath & "Capture:" & SkuFolderName & ":")) as string
      do shell script "/bin/mkdir -p " & newFolder
      move inside newFolder variants {var} --fails
   end tell
end tell
rapdigital
Certified Professional
Certified Professional
 
Posts: 167
Joined: Mon Feb 02, 2009 1:52 pm

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

Postby SeanMurp » Tue Sep 25, 2018 5:13 pm

Hey Rick,
Looks they need to be a collection first. If you don't mind creating Favorites for each of the SkuNameFolders you can use these three lines of code between the ########s:

Code: Select all
tell application "Capture One 11"
   set SessionPath to folder of current document as string
   set SkuFolderName to "SkuFolderName"
   tell current document
      set aVar to variant 1 of collection 1
      set newFolder to quoted form of (POSIX path of (SessionPath & "Capture:" & SkuFolderName & ":")) as string
      do shell script "/bin/mkdir -p " & newFolder
      #######
      set newFolderHFS to SessionPath & "Capture:" & SkuFolderName & ":" as alias
      
      make new collection with properties {kind:favorite, file:newFolderHFS}
      set collectionName to collection SkuFolderName
      #######
      move inside collectionName variants {aVar}
   end tell
end tell
SeanMurp
 
Posts: 71
Joined: Wed Nov 02, 2016 4:30 am

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

Postby SeanMurp » Thu Sep 27, 2018 10:55 pm

Did you perhaps reply to the wrong message? No Netgear involvement here.
SeanMurp
 
Posts: 71
Joined: Wed Nov 02, 2016 4:30 am

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

Postby John Doe » Thu Sep 27, 2018 11:28 pm

SeanMurp wrote:Did you perhaps reply to the wrong message? No Netgear involvement here.

It's just one of many spam messages that get posted now and then on this forum. Please ignore.
Sony DSC-RX100 - Capture One Pro 10.2.1 (macOS Sierra 10.12.6)
THIS IS A USER TO USER FORUM. FOR FEATURE REQUESTS AND BUG REPORTS, FILE A SUPPORT CASE AT https://www.phaseone.com/SupportMain.aspx
John Doe
 
Posts: 992
Joined: Sun Jan 31, 2016 10:15 pm


Return to Scripting



Who is online

Users browsing this forum: Eric Nepean and 1 guest