Create new session from macro
Title
Create new session from macro
What do you expect to happen when you run the script/macro?
macro automatically creates a session from a template
Are you seeing an error?
the macro works perfectly the first two times, and the third time it crashes when it has to cut the audio from the video and then copy it to the "original" track
What happens when you run this script?
0) to start the macro you need to have the folder open where inside are all the videos to do the sessions with. I create the first operation from the keyboard, that is, I copy the name of the video then launch the macro (leaving the folder with the videos open).
The macro:
- launches protools
- copies the name
- launches protools.
- goes to the first pt track (in my case "mic").
- import session video
- push tab to go to "search" and paste the name again to search for the video.
- find the ideo and select it.
- import video
- saves the audio file of the video to a folder whose directory I write to it via shortcut
- wait for the audio to be imported.
- selects the audio clip
- cuts the audio clip. (by doing this the track will be empty).
- scroll to the "original" track.
- paste
- go back to the previous position (so go back to the empty track - from step 12)
- delete the track
- save and close session.
at this point they are automatically on the finder folder where the videos are. (step 0).
18) the macro starts via press key the selection of the next video, and copies it.
At this I restart the macro by resuming the stream deck button.
These operations work perfectly until the second session is created.
But the third time it crashes when it has to do step 11-12.
How were you running this script?
I used a Stream Deck button
How important is this issue to you?
5
Details
{ "inputExpected": "macro automatically creates a session from a template", "inputIsError": true, "inputError": "the macro works perfectly the first two times, and the third time it crashes when it has to cut the audio from the video and then copy it to the \"original\" track", "inputWhatHappens": "0) to start the macro you need to have the folder open where inside are all the videos to do the sessions with.\nI create the first operation from the keyboard, that is, I copy the name of the video then launch the macro (leaving the folder with the videos open).\n\nThe macro: \n\n1) launches protools\n2) copies the name\n3) launches protools.\n4) goes to the first pt track (in my case \"mic\"). \n5) import session video\n6) push tab to go to \"search\" and paste the name again to search for the video.\n7) find the ideo and select it.\n8) import video\n9) saves the audio file of the video to a folder whose directory I write to it via shortcut\n10) wait for the audio to be imported.\n11) selects the audio clip\n12) cuts the audio clip. (by doing this the track will be empty).\n13) scroll to the \"original\" track.\n14) paste\n15) go back to the previous position (so go back to the empty track - from step 12)\n16) delete the track\n17) save and close session.\n\nat this point they are automatically on the finder folder where the videos are. (step 0).\n18) the macro starts via press key the selection of the next video, and copies it.\n\nAt this I restart the macro by resuming the stream deck button.\n\nThese operations work perfectly until the second session is created.\nBut the third time it crashes when it has to do step 11-12.", "inputHowRun": { "key": "-MpfwmPg-2Sb-HxHQAff", "title": "I used a Stream Deck button" }, "inputImportance": 5, "inputTitle": "Create new session from macro " }
Source
//Macro converted to script
sf.app.launch({
path: "/Applications/Pro Tools.app",
});
sf.wait({
intervalMs: 400,
});
sf.keyboard.press({
keys: "cmd+n",
fast: true,
});
sf.wait({
intervalMs: 250,
});
sf.keyboard.press({
keys: "cmd+v",
fast: true,
});
sf.wait({
intervalMs: 250,
});
sf.keyboard.press({
keys: "up, shift+slash, s, f, shift+slash",
fast: true,
});
sf.wait({
intervalMs: 100,
});
sf.keyboard.press({
keys: "return",
fast: true,
});
sf.wait({
intervalMs: 1000,
});
sf.keyboard.press({
keys: "return",
fast: true,
});
sf.wait({
intervalMs: 1000,
});
sf.keyboard.press({
keys: "return",
fast: false,
});
sf.wait({
intervalMs: 300,
});
sf.ui.proTools.trackGetByName({ name: "Mic", makeVisible: true }).track.trackSelect();
sf.proTools.trackGetFirstSelectedTrackHeader();
sf.wait({
intervalMs: 300,
});
//Calling command "Import - Video..." from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/clcf936ky0000l110ggp9f9bf")
sf.soundflow.runCommand({
commandId: 'user:ckp49i4j60000a2100yfwywgf:cktcnf0ra000x9r109i8wen1u#cktcmu1ek000l9r107c7eyej0',
props: {}
});
sf.ui.proTools.windows.whoseTitle.is("Open").first.children.whoseRole.is("AXStaticText").whoseValue.is("Select Video File To Import:").first.elementWaitFor({
failIfNotFound: false,
pollingInterval: 50,
timeout: 5000,
});
sf.wait({
intervalMs: 200,
});
sf.keyboard.press({
keys: "tab",
fast: true,
});
sf.wait({
intervalMs: 200,
});
sf.keyboard.press({
keys: "cmd+v",
fast: false,
});
sf.wait({
intervalMs: 1000,
});
sf.keyboard.press({
keys: "tab, tab, down, return",
fast: false,
});
sf.ui.proTools.windows.whoseTitle.is("Video Import Options").first.getElement("AXTitleUIElement").elementWaitFor({
failIfNotFound: false,
pollingInterval: 50,
timeout: 50,
});
sf.keyboard.press({
keys: "return",
fast: true,
});
sf.ui.proTools.windows.whoseTitle.is("Open").first.children.whoseRole.is("AXStaticText").whoseValue.is("Choose a destination folder").first.elementWaitFor({
failIfNotFound: false,
pollingInterval: 50,
timeout: 100,
});
//Calling command "_VAI A - HD - AUDIO" from package "Default Package"
sf.soundflow.runCommand({
commandId: 'package:cld1ikvnm0000rl102inpkukf',
props: {}
});
/* sf.keyboard.press({
keys: "tab, tab, down, return",
fast: true,
}); */
sf.keyboard.press({
keys: "return",
fast: true,
});
sf.ui.proTools.confirmationDialog.children.whoseRole.is("AXStaticText").whoseValue.is("Processing Audio").first.elementWaitFor({
waitType: "Disappear",
failIfNotFound: true,
pollingInterval: 2000,
timeout: 180000,
});
sf.wait({
intervalMs: 600,
});
sf.ui.proTools.clipSelectNextFullClip();
sf.wait({
intervalMs: 400,
});
sf.keyboard.press({
keys: "cmd+x",
});
sf.ui.proTools.trackGetByName({ name: "Original", makeVisible: true }).track.trackSelect();
sf.wait({
intervalMs: 500,
});
sf.keyboard.press({
keys: "cmd+v",
});
sf.wait({
intervalMs: 450,
});
//Calling command "POSIZIONE PRECEDENTE" from package "Default Package"
sf.soundflow.runCommand({
commandId: 'package:clcun3uxa0000ji104hakej16',
props: {}
});
sf.wait({
intervalMs: 500,
});
//Calling command "DELETE PISTA" from package "Default Package"
sf.soundflow.runCommand({
commandId: 'package:clcun7qx20001ji10k9osopao',
props: {}
});
sf.wait({
intervalMs: 500,
});
sf.keyboard.press({
keys: "cmd+s",
});
sf.wait({
intervalMs: 500,
});
sf.keyboard.press({
keys: "cmd+shift+w",
});
sf.wait({
intervalMs: 500,
});
sf.keyboard.press({
keys: "cmd+tab, down",
});
sf.wait({
intervalMs: 350,
});
sf.keyboard.press({
keys: "return, cmd+c, return",
});
sf.wait({
intervalMs: 350,
});
Links
User UID: UAy4M0RvuBSVz2Rj8ENsLcvQsyH2
Feedback Key: sffeedback:UAy4M0RvuBSVz2Rj8ENsLcvQsyH2:-NM3XnCPYMaFleeFTA7o
- Sstudio@keasound.com @studiokeasound_com
Just to add more details.
I am attaching a picture file where you can see what happens.