Author Topic: Found a possible problem.  (Read 2601 times)

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Found a possible problem.
« on: June 05, 2020, 03:49:31 AM »
I exported this command, to send to a friend.

Code: [Select]
Start Loop While :  Keyboard Key 'F21' Is Pressed
    Set small int (condition) [Seconds] value as incremented by 1
    Write [Blue] '{SMALL:Seconds}' to log
    Pause 0.1 seconds
    Begin Small Integer Compare : [Seconds] Is Greater Than 3
        Begin Text Compare : [{ACTIVEWINDOWTITLE}] Ends With 'YouTube - Opera'
            Write (overwrite), 'youtube-dl -f -v --embed-subs --write-auto-sub --hls-prefer-native --write-all-thumbnails --embed-thumbnail --add-metadata -f "bestvideo[height<=720]+be...
            Run application 'C:\Program Files (x86)\VoiceAttack\Apps\Youtube-DL\Mine.bat'
        End Condition - Exit when condition met
    End Condition - Exit when condition met
End Loop
Begin Small Integer Compare : [Seconds] Is Less Than 3
    Press Left Ctrl+C keys and hold for 0.3 seconds and release
    Write (overwrite), 'youtube-dl -f -v --embed-subs --write-auto-sub --hls-prefer-native --write-all-thumbnails --embed-thumbnail --add-metadata -f "bestvideo[height<=720]+be...
    Run application 'C:\Program Files (x86)\VoiceAttack\Apps\Youtube-DL\Mine.bat'
End Condition - Exit when condition met

You can't see the whole Write (overwrite), command there. I'll write the whole thing out.

youtube-dl -f -v --embed-subs --write-auto-sub --hls-prefer-native --write-all-thumbnails --embed-thumbnail --add-metadata -f "bestvideo[height<=720]+bestaudio/best[height<=720]" -o "D:\Download Videos/%%(title)s.%%(ext)s" {CLIP} --merge-output-format mkv
Timeout 3

That's what the whole command should look like. Now, if I export it, and import it back into VA, it adds some random characters to the command. Making the command look like this.

youtube-dl -f -v --embed-subs --write-auto-sub --hls-prefer-native --write-all-thumbnails --embed-thumbnail --add-metadata -f "bestvideo[height<=720]+bestaudio/best[height<=720]" -o "D:\Download Videos/%%(title)s.%%(ext)s" {CLIP} --merge-output-format mkv+^%^~|~+Timeout 3

Each time I export and then import this command, I'm getting the same random characters.

You may already know the answer for this, but if not, I'll attach the profile, and you can test it for yourself.


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Found a possible problem.
« Reply #1 on: June 05, 2020, 07:11:53 AM »
It appears this is an issue with the newer .vap format when using carriage return/newline in that action.

The other text doesn't matter; E.G.
Code: [Select]
a
a
a
will produce the same characters:
Code: [Select]
Write (do not overwrite), 'a+^%^~|~+a+^%^~|~+a' to file 't'


The "VoiceAttack Profile Expanded as XML (*.vap)" export option does not exhibit this issue.


It does appear to be specific to the "Write Text to a File" action, as this does not occur when using multiple lines in the "Say Something with Text-To-Speech" or "Set a Text Value to the Windows Clipboard" actions.


There was a change made to the "Write Text to a File" action in v1.6.2:
Quote from: https://voiceattack.com/changes.aspx
Exporting, 'Write Text to File' actions would not preserve cr/lf.  This has been fixed.
May not be relevant at all, or it could be that this fix is either interfering with, or needs to be applied to, the new export method.


EDIT: Still applies to v1.8.7.4
« Last Edit: November 02, 2020, 10:52:07 AM by Pfeil »

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Found a possible problem.
« Reply #2 on: June 05, 2020, 08:29:04 AM »
Yeah, that would make sense, because there is a carriage return before the time out. I figured it was something like that. I just didn't know if anyone was aware of the problem.