Separate copied text

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Separate copied text

Post by RNIB » Tue Sep 05, 2017 4:03 pm

I'm not too sure of the correct terminology to use here but I want to verify the properties of an audio file using Adobe Audition.

If I open an audio file in Audition and press Ctrl+P it opens the file properties. If I somehow (yet to be worked out how) I click on the Broadcast Wave tab (there are 7 tabs and Broadcast Wave is the 5th one along) I can then tab 8 times to get to the Coding History field. This is a text field that will show something like:

A=PCM,F=44100,W=16,M=mono,T=SADiE6

That is exactly how a sample file is presented

A=File format in this case PCM Wav file
F= Sample rate, 44.1Khz
W = bit rate, 16bit
M= channels, mono
T= the program that created the file, but we aren't interested in that.

What I would like to do is write something that checks these elements and brings up a message If the properties are not correct.

Basically I want to do the following:
If A doesn't equal PCM message "This is not a WAV file"
If F doesn't equal 44100 message "This is not at 44.1Khz"
If W doesn't equal 16 message "This is not a 16bit file"
If M doesn't equal mono message "This is not a mono file"

As the original text is comma delimited I guess I could use the separate function in MacroScheduler but I've never done that before and not sure how you then check the relevant values.

Any ideas?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Separate copied text

Post by Marcus Tettmar » Wed Sep 06, 2017 2:14 pm

One way to do it, is use the Separate command which separates a string list based on a given delimiter. So you'd do it twice - first with the comma and then with = sign for each part. E.g.:

Code: Select all

Separate>text_sample,COMMA,parts
//F=whatever would be the second item
Separate>parts_2,=,f_parts
//F value is f_parts_2
MessageModal>f_parts_2
For A you'd look at parts_1 and so on.

Another way would be to use RegEx:

Code: Select all

//The F value
Let>ITEM_NAME=F
Let>pattern=(?<=%ITEM_NAME%\=).*?(?=\,)|(?<=%ITEM_NAME%\=).*?
RegEx>pattern,text_sample,0,matches,nm,0
MessageModal>%ITEM_NAME% is %matches_1%
Note how could you turn this into a subroutine where ITEM_NAME is the identifier you want to retrieve the value for.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Wed Sep 06, 2017 2:47 pm

Ahh okay, yes I think I follow. RegEx is a bit beyond my knowledge. I've used it once before but needed a lot of help from these forums. I can definitely see how it's the more useful option but I think I'll have a go at the Separate command.

Many thanks for the help and pointing me in the right direction.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Separate copied text

Post by Marcus Tettmar » Wed Sep 06, 2017 3:16 pm

My separate method assumes the items are always in the same order - e.g. you know that F= is the second item. The benefit of the RegEx version is that the order doesn't matter. The pattern is saying look for anything between ITEM_NAME= and a comma, or end of string. So if you want F you set ITEM_NAME to F and it finds anything between F= and , or F= and end. Which gives you the value you want.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Wed Sep 06, 2017 3:19 pm

I see. Hmm. I might have to use RegEx as, unless I'm doing something wrong, it seems that Separate doesn't work with a variable.

I'm copying the text to the clipboard then using Getclipboard to save it as a variable but Separate doesn't seem to like me specifying the variable as the List.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Separate copied text

Post by Marcus Tettmar » Thu Sep 07, 2017 8:24 am

Separate definitely works with a variable. All commands work with a variable. They all use the same parser after all.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Thu Sep 07, 2017 11:10 am

Okay well I'm very confused :? :?


This is the checking part of my macro

Code: Select all

SRT>StereoCheck
WaitWindowOpen>Adobe Audition - Untitled*
Press Ctrl
Send>p
Release Ctrl
WaitWindowOpen>File Info
SetFocus>File Info
Press Tab*8
Wait>1
Press Ctrl
Send>a
Wait>1
Release Ctrl
Press Ctrl
send>c
Release Ctrl
Wait>1
GetClipBoard>clip
Separate>clip,COMMA,parts
//A=whatever would be the 1st item
//Separate>parts_1,=,a_part
//F=whatever would be the 2nd item
Separate>parts_2,=,f_part
//F value is f_parts_2
//W=whatever would be the 3rd item
//Separate>parts_3,=,w_part
MessageModal>%f_part_1%
The message I should get is "44100" but instead I get "parts_2"

If I change the MessageModal to %f_part_2% the message is get is "%f_part_2%"

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Fri Sep 08, 2017 9:33 am

Well I've found out why it's not working, I just don't understand why it's doing what it's doing.

Code: Select all

SRT>StereoCheck
WaitWindowOpen>Adobe Audition - Untitled*
Press Ctrl
Send>p
Release Ctrl
WaitWindowOpen>File Info
SetFocus>File Info
Press Tab*8
Wait>1
Press Ctrl
Send>a
Wait>1
Release Ctrl
Press Ctrl
send>c
Release Ctrl
Wait>1

GetClipBoard>clip
Separate>clip,COMMA,parts
//A=whatever would be the 1st item
MessageModal>Part 1=%parts_1%, Part 2=%parts_2%, Part 3=%parts_3%, Part 4=%parts_4%
The text that is copied in the first part is this (I've literally copied and pasted it here) :

A=PCM,F=44100,W=16,M=mono,T=SADiE6

The message I get is:

Part 1=A=PCM,F=44100,W=16,M=mono,T=SADiE6, Part 2=%parts_2%, Part 3=%parts_3%, Part 4=%parts_4%

So it appears that Separate isn't separating at the commas.

I've tried changing the separate command to Separate>clip,,,parts but that just didn't work at all.

Does Separate only work if there is a space after a comma?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Separate copied text

Post by JRL » Fri Sep 08, 2017 12:45 pm

Separate> separates by the exact text you specify. What version of Macro Scheduler are you using? "Comma" has not always been a built in variable or you might have reset the variable "comma" to something else somewhere in previous code. Try adding a line:

Let>comma=,

prior to using the Separate> by comma.

The message I get is:

Part 1=A=PCM, Part 2=F=44100, Part 3=W=16, Part 4=M=mono

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Fri Sep 08, 2017 12:57 pm

Unfortunately I am using an old version of MS, version 10 :oops:

I've added your suggested line before the separate command but weirdly now what happens is that the message box doesn't come up at all but I hear the Windows default beep sound.

Looking through the code for this macro I can't see anything that does anything at all with commas.

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Separate copied text

Post by JRL » Fri Sep 08, 2017 1:38 pm

post your code. I want to see the getclipboard and the Let>comm=, on through to the message.

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Fri Sep 08, 2017 1:47 pm

This is the code for the subroutine I'm currently working on (there isn't yet an end to to the subroutine as it's a work in progress)

Code: Select all

SRT>StereoCheck
WaitWindowOpen>Adobe Audition - Untitled*
Press Ctrl
Send>p
Release Ctrl
WaitWindowOpen>File Info
SetFocus>File Info
Press Tab*8
Wait>1
Press Ctrl
Send>a
Wait>1
Release Ctrl
WaitKeyDown>c
Press Ctrl
send>c
Release Ctrl
Wait>1
GetClipBoard>clip
Let>COMMA=,
Wait>1
Separate>clip,COMMA,parts
//A=whatever would be the 1st item
MessageModal>Part 1=%parts_1%, Part 2=%parts_2%, Part 3=%parts_3%, Part 4=%parts_4%
//Separate>parts_1,=,a_part
//F=whatever would be the 2nd item
//Separate>parts_2,=,f_part
//F value is f_parts_2
//W=whatever would be the 3rd item
//Separate>parts_3,=,w_part
//MessageModal>%f_part_1%
This is part of a much longer macro detailed here.

Code: Select all

//Make Sure Caps Lock is off
CapsOff
//Clear all variables to prevent wrong paths being sent
Let>TotalParts=
Let>AF1=
Let>AF2=
Let>AF3=
Let>AF4=
Let>ProdNumber=
Let>PubDate=
Let>ProducerName=
Let>SaveDrive=
//Ask if the magazine has multiple parts
Let>INPUT_BROWSE=0
Input>TotalParts,How Many Parts Does This Magazine Have?,2
IF>TotalParts=
Exit>0
EndIF
//Can never be 1,3 or more than 4 parts.
IF>TotalParts=1
Exit>0
Endif
If>TotalParts=2
Let>INPUT_BROWSE=2
Input>AF1,Please select the folder containing the files for Part 1.,
IF>AF1=
Exit>0
EndIf
Let>INPUT_BROWSE=2
Input>AF2,Please select the folder containing the files for Part 2.,
IF>AF2=
Exit>0
EndIf
Else
Let>INPUT_BROWSE=2
Input>AF1,Please select the folder containing the files for Part 1.,
IF>AF1=
Exit>0
EndIf
Let>INPUT_BROWSE=2
Input>AF2,Please select the folder containing the files for Part 2.,
IF>AF2=
Exit>0
EndIf
Let>INPUT_BROWSE=2
Input>AF3,Please select the folder containing the files for Part 3.,
IF>AF3=
Exit>0
EndIf
Let>INPUT_BROWSE=2
Input>AF4,Please select the folder containing the files for Part 4.,
IF>AF4=
Exit>0
EndIf
EndIF
//Continue with rest of data gathering
Let>INPUT_BROWSE=0
Input>ProdNumber,Please Enter The Production Number?,150
If>ProdNumber=
Exit>0
EndIF
Let>INPUT_BROWSE=0
Input>PubDate,Please Enter The Publication Date As YYMMDD?,
If>PubDate=
Exit>0
EndIF
Let>INPUT_BROWSE=0
Input>ProducerName,Please Enter The Initials of The Audio Producer,
If>ProducerName=
Exit>0
EndIF
Let>INPUT_BROWSE=2
Input>SaveDrive,Please Select Where You Want The File Saved,
If>SaveDrive=
Exit>0
EndIF

//If there are two parts use subroutines
If>TotalParts=2
GoSub>Part1
GoSub>Part2
Else
GoSub>Part1
GoSub>Part2
GoSub>Part3
GoSub>Part4
EndIF

//PART 1 SUBROUTINE
SRT>Part1
Let>PartNo=1
//Make Sure Caps Lock is off
CapsOff
GoSub>ImportFiles
Send>%AF1%
GoSub>ReverseFiles
GoSub>StereoCheck
GoSub>OddSides
GoSub>SaveFile
End>Part1
//PART 2 SUBROUTINE
SRT>Part2
Let>PartNo=2
//Make Sure Caps Lock is off
CapsOff
GoSub>ImportFiles
Send>%AF2%
GoSub>ReverseFiles
GoSub>EvenSides
GoSub>SaveFile
GoSub>CheckFiles
GoSub>Report
End>Part2
//PART 3 SUBROUTINE
SRT>Part3
Let>PartNo=3
//Make Sure Caps Lock is off
CapsOff
GoSub>ImportFiles
Send>%AF3%
GoSub>ReverseFiles
GoSub>OddSides
GoSub>SaveFile
End>Part3
//PART 4 SUBROUTINE
SRT>Part4
Let>PartNo=4
//Make Sure Caps Lock is off
CapsOff
GoSub>ImportFiles
Send>%AF4%
GoSub>ReverseFiles
GoSub>EvenSides
GoSub>SaveFile
GoSub>CheckFiles
GoSub>Report
End>Part4
//IMPORT FILES SUBROUTINE
SRT>ImportFiles
SetFocus>Adobe Audition*
//Maximise the window
WindowAction>1,Adobe Audition*
Wait>1
//makes sure Audition is set to Edit view
Send>8
//Open Append
Press Ctrl
Press Shift
Send>o
Release Ctrl
Release Shift
WaitWindowOpen>Open Append
Wait>1
//Set Files of type to All Supported Media
Press Alt
Send>t
Release Alt
Press Home
Press Enter
Wait>1
//Locate to File Name Field
Press Alt
Send>n
Release Alt
Wait>1
END>ImportFiles
//REVERSE FILES SUBROUTINE
SRT>ReverseFiles
Wait>1
Press Enter
Wait>2
SetFocus>Open Append
MouseMoverel>98,146
Wait>1
LClick
//select in reverse order
Wait>1
Press End
Press Shift
Press Home
Release Shift
Wait>1
//load audio
Press Enter
WaitWindowOpen>Adobe Audition - Untitled*
End>ReverseFiles


//Stereo Check
SRT>StereoCheck
WaitWindowOpen>Adobe Audition - Untitled*
Press Ctrl
Send>p
Release Ctrl
WaitWindowOpen>File Info
SetFocus>File Info
Press Tab*8
Wait>1
Press Ctrl
Send>a
Wait>1
Release Ctrl
WaitKeyDown>c
Press Ctrl
send>c
Release Ctrl
Wait>1
GetClipBoard>clip
Let>COMMA=,
Wait>1
Separate>clip,COMMA,parts
//A=whatever would be the 1st item
MessageModal>Part 1=%parts_1%, Part 2=%parts_2%, Part 3=%parts_3%, Part 4=%parts_4%
//Separate>parts_1,=,a_part
//F=whatever would be the 2nd item
//Separate>parts_2,=,f_part
//F value is f_parts_2
//W=whatever would be the 3rd item
//Separate>parts_3,=,w_part
//MessageModal>%f_part_1%









//ODD SIDES METADATA SUBROUTINE
SRT>OddSides
//Zoom out full horizontally
//This is the default hotkey for zoom out full horizontally in Audition
Send>\
//Zoom in two levels this is based on an expected side length of around 37mins which should then move the marker point back from the end by 13 frames
//This is the default hotkey in Audition for Zoom in horizontally
Send>=
Send>=
Wait>1
//Jump to end of file
Press End
Wait>1
//Backup slightly from the end to avoid the bug where Audition won't save CD Tracks
//MUST HAVE HOTKEYs DEFINED IN AUDITION RR Start = Ctrl+Shift+R & RR Stop = Ctrl+Shift+x
Press Ctrl
Press Shift
send>r
Release shift
Release Ctrl
Wait>0.1
Press Ctrl
Press Shift
send>x
Release shift
Release Ctrl
//open marker list
Press Alt
Send>8
Release Alt
Wait>1
//Add Track Marker to end
Press F8
Wait>1
//Rename CD Marker
Press Tab*3
Wait>1
Send>CD Track 01
//Set Marker Type to Track
Press Tab*4
Press Down
Press Home
Press Down*2
Press Enter
Wait>1
//Add r to the description
Press Tab*7
Wait>1
Send>r
Press Enter
Wait>1
//delete first track
Press Tab
Press Home
Press Del
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
//Go to the first marker
Press Home
//Add s to the description
Press Tab*7
Send>s
Press Enter
Wait>1
//Click in the marker window. Needed to ensure the marker window is closed properly and that the macro can continue safely.
MouseMoveRel>430,119
LClick
Wait>1
Press Alt
Send>8
Release ALT
End>OddSides
//EVEN SIDES METADATA SUBROUTINE
SRT>EvenSides
//Zoom out full horizontally
//This is the default hotkey for zoom out full horizontally in Audition
Send>\
//Zoom in two levels this is based on an expected side length of around 37mins which should then move the marker point back from the end by 13 frames
//This is the default hotkey in Audition for Zoom in horizontally
Send>=
Send>=
Wait>1
//Jump to end of file
Press End
Wait>1
//Backup slightly from the end to avoid the bug where Audition won't save CD Tracks
//MUST HAVE A HOTKEYs DEFINED IN AUDITION RR Start = Ctrl+Shift+R & RR Stop = Ctrl+Shift+x
Press Ctrl
Press Shift
send>r
Release shift
Release Ctrl
Wait>0.1
Press Ctrl
Press Shift
send>x
Release shift
Release Ctrl
//open marker list
Press Alt
Send>8
Release Alt
//Add Track Marker to end
Press F8
Wait>1
//Rename CD Marker
Press Tab*3
Wait>1
Send>CD Track 01
//Set marker Type to Track
Press Tab*4
Press Down
Press Home
Press Down*2
Press Enter
Wait>1
//Add r to the description
Press Tab*7
Send>r
Press Enter
Wait>1
//delete first track
Press Tab
Press Home
Press Del
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
//Select 2nd from last marker
Press End
Press Up
//Add s to the description
Press Tab*7
Send>s
Press Enter
Wait>1
//Click in the marker window. Needed to ensure the window is closed properly and the macro can continue safely.
MouseMoveRel>430,119
LClick
Wait>1
Press Alt
Send>8
Release Alt
End>EvenSides
//SAVE FILE SUBROUTINE
SRT>SaveFile
SetFocus>Adobe Audition - Untitled*
Wait>0.5
//save the file
Press Ctrl
Press Shift
Send>s
Release Shift
Release Ctrl
WaitWindowOpen>Save As
SetFocus>Save As
//Check if save extra non-audio information check box is ticked
Wait>1
GetCheckBox>Save As,Save extra non-audio information,bChecked
Wait>1
If>bChecked=1
Goto>end
Else
SetFocus>Save As
SetCheckBox>Save As,Save extra non-audio information,TRUE
Label>end
//Set Save As Type to WAV
Press Alt
Send>t
Release Alt
Press Down
Press End
Press Up
Press Enter
Wait>1
Press Alt
Send>n
Release Alt
Wait>1
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_%PartNo%.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_%PartNo%*
Wait>2
Press Alt
Send>fc
Press Enter
Release Alt
End>SaveFile
SRT>CheckFiles
SetFocus>Adobe Audition*
If>TotalParts=2
GoSub>2Parts
Else
GoSub>4Parts
EndIF
SRT>2Parts
//Open 1st File
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
//Part 1
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_1.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_1*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press Home
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side1S
Wait>1
Press Tab
Wait>1
Press End
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side1R
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_1*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
SetFocus>Adobe Audition*
//Part 2
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_2.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_2*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press End
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side2R
Wait>1
Press Tab
Wait>1
Press End
Wait>1
Press Up
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side2S
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_2*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
End>2Parts
SRT>4Parts
SetFocus>Adobe Audition*
//Open 1st File
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
//Part 1
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_1.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_1*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press Home
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side1S
Wait>1
Press Tab
Wait>1
Press End
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side1R
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_1*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
SetFocus>Adobe Audition*
//Part 2
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_2.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_2*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press End
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side2R
Wait>1
Press Tab
Wait>1
Press End
Press Up
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side2S
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_2*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
SetFocus>Adobe Audition*
//Open 3rd File
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
//Part 3
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_3.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_3*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press Home
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side3S
Wait>1
Press Tab
Wait>1
Press End
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side3R
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_3*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
SetFocus>Adobe Audition*
//Part 4
Press Ctrl
Send>o
Release Ctrl
WaitWindowOpen>Open
SetFocus>Open
Wait>1
Press Alt
Send>n
Release Alt
Send>%SaveDrive%\%ProdNumber%_%PubDate%_%ProducerName%_4.wav
Wait>1
Press Enter
WaitWindowOpen>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_4*
Wait>2
//Open Marker List
Press Alt
Send>8
Release Alt
Wait>1
MouseMoveRel>430,119
LClick
Wait>1
Press End
Wait>1
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side4R
Wait>1
Press Tab
Press End
Wait>1
Press Up
Press Tab*7
Wait>1
Press Ctrl
Send>c
Release Ctrl
Wait>1
GetClipBoard>side4S
Wait>1
//Close Marker Window
Press Alt
Send>8
Release Alt
//Close File
SetFocus>Adobe Audition - %ProdNumber%_%PubDate%_%ProducerName%_4*
Press Ctrl
Send>w
Release Ctrl
WaitWindowOpen>Adobe Audition*
End>4Parts
End>CheckFiles
SRT>Report
If>TotalParts=2
Gosub>2PartCheck
Else
GoSub>4PartCheck
EndIF
SRT>2PartCheck
If>side1R=r
Let>side1Rcheck=1
Else
Let>side1Rcheck=0
EndIF
If>side1S=s
Let>side1Scheck=1
Else
Let>side1Scheck=0
EndIF
If>side2R=r
Let>side2Rcheck=1
Else
Let>side2Rcheck=0
EndIF
If>side2S=s
Let>side2Scheck=1
Else
Let>side2Scheck=0
EndIf
End>2PartCheck
SRT>4PartCheck
If>side1R=r
Let>side1Rcheck=1
Else
Let>side1Rcheck=0
EndIF
If>side1S=s
Let>side1Scheck=1
Else
Let>side1Scheck=0
EndIF
If>side2R=r
Let>side2Rcheck=1
Else
Let>side2Rcheck=0
EndIF
If>side2S=s
Let>side2Scheck=1
Else
Let>side2Scheck=0
EndIf
If>side3R=r
Let>side3Rcheck=1
Else
Let>side3Rcheck=0
EndIf
If>side3S=s
Let>side3Scheck=1
Else
Let>side3Scheck=0
EndIf
If>side4R=r
Let>side4Rcheck=1
Else
Let>side4Rcheck=0
Endif
If>side4S=s
Let>side4Scheck=1
Else
Let>Side4Scheck=0
EndIF
End>4PartCheck
//Compile report
If>TotalParts=2
GoSub>2PartReport
Else
GoSub>4PartReport
EndIf
Srt>2PartReport
//SIDE 1
If>%side1Rcheck%+%side1Scheck%=2
Let>Side1Report=Side 1 is correct and can be submitted to the Newsagent portal.
Else
If>%side1Rcheck%+%side1Scheck%=0
Let>Side1Report=Side 1 is missing both the S & R markers. This needs to be fixed before it can be submitted.
Else
If>%side1Scheck%=0
Let>Side1Report=Side 1 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side1Report=Side 1 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
//SIDE 2
If>%side2Rcheck%+%side2Scheck%=2
Let>Side2Report=Side 2 is correct and can be submitted to the Newsagent portal.
Else
If>%side2Rcheck%+%side2Scheck%=0
Let>Side2Report=Side 2 is missing both the S & R markers. This needs to be fixed before it can be submitted.
Else
If>%side2Scheck%=0
Let>Side2Report=Side 2 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side2Report=Side 2 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
Message>%Side1Report%, %Side2Report%
end>2PartReport
srt>4PartReport
//SIDE 1
If>%side1Rcheck%+%side1Scheck%=2
Let>Side1Report=Side 1 is correct and can be submitted to the Newsagent portal.
Else
If>%side1Rcheck%+%side1Scheck%=0
Let>Side1Report=Side 1 is missing both the S & R markers. This needs to be fixed before it can be submitted.
Else
If>%side1Scheck%=0
Let>Side1Report=Side 1 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side1Report=Side 1 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
//SIDE 2
If>%side2Rcheck%+%side2Scheck%=2
Let>Side2Report=Side 2 is correct and can be submitted to the Newsagent portal.
Else
If>%side2Rcheck%+%side2Scheck%=0
Let>Side2Report=Side 2 is missing both the S & R markers. This needs to be fixed before it can be submitted.
Else
If>%side2Scheck%=0
Let>Side2Report=Side 2 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side2Report=Side 2 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
/SIDE 3
If>%side3Rcheck%+%side3Scheck%=2
Let>Side3Report=Side 3 is correct and can be submitted to the Newsagent portal.
Else
If>%side3Rcheck%+%side3Scheck%=0
Let>Side3Report=Side 3 is missing both the S & R markers. This needs to be fixed before it can be submitted.
Else
If>%side3Scheck%=0
Let>Side3Report=Side 3 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side3Report=Side 3 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
If>%side4Rcheck%+%side4Scheck%=2
Let>Side4Report=Side 4 is correct and can be submitted to the Newsagent portal.
Else
If>%side4Rcheck%+%side4Scheck%=0
Let>Side4Report=Side 4 is missing the R market. This needs to be fixed before it can be submitted.
Else
If>%side4Scheck%=0
Let>Side4Report=Side 4 is missing the S marker. This needs to be fixed before it can be submitted.
Else
Let>Side4Report=Side 4 is missing the R market. This needs to be fixed before it can be submitted.
Endif
endif
endif
Message>%Side1Report%, %Side2Report%, %Side3Report%, %Side4Report%
end>4PartReport
End>Report


User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Separate copied text

Post by JRL » Fri Sep 08, 2017 3:27 pm

I don't see any reason the script would quit. Put a modal message after the getclipboard line and view variable "clip" to make sure you are acquiring what you think you are acquiring and to make sure the script is getting to that point.

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Separate copied text

Post by RNIB » Fri Sep 08, 2017 3:42 pm

Ahh! I take it back. Just realised why it wasn't working. I'd left a WaitKeyDown>c in that subroutine whilst I was testing something else out (I was manually adding a space before the commas to see if that would make separate work before pressing c to continue the script- it didn't)

Now, with your Let>comma=, it now does correctly separate the text. Phew, thought I was going mad for a minute.

So now I need to run separate again for each element I need to separate out.

No doubt I'll be back again with more questions :lol:

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts