#Context menu with Powershell
for ($i = 1; $i -le 500; $i++) {
[System.Windows.Forms.SendKeys]::SendWait("^+{F10}")
Write-Host "Iteration: $i"
}
#Context menu with Powershell
for ($i = 1; $i -le 500; $i++) {
[System.Windows.Forms.SendKeys]::SendWait("^+{F10}")
Write-Host "Iteration: $i"
}
1) Download Node JS in nodejs.org
2) Go to downloads
3) Download msi file
4) At last after finish installation, Click on close while install Additional Tools for Node.js
ref:- https://nodesource.com/blog/installing-nodejs-tutorial-windows
After installing, you can generate subtitles for videos in node js by below link
sample video link, below
ref:-https://storage.googleapis.com/aai-web-samples/aai-overview.mp4
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
' Define the mouse events
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_ABSOLUTE = &H8000
Public Const MOUSEEVENTF_MOVE = &H1
Sub SimulateLeftClick(ByVal x As Long, ByVal y As Long)
' Move the cursor to the specified coordinates (screen coordinates)
SetCursorPos x, y
' Perform the left click (Down and then Up)
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Sub TestClick()
' Clicks at screen coordinates X=50, Y=50
Call SimulateLeftClick(40, 200)
End Sub
Enter below text in Chrome URL
data:text/html, <title>Notepad</title><body contenteditable style="font-size:18px;line-height:1.6;font-family:sans-serif;">
>Open Windows Explorer
> Go to View
> Uncheck navigation Pane
<html>
<head>
<link href="https://vjs.zencdn.net/8.23.4/video-js.css" rel="stylesheet" />
<!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js">
function init() {
var url = "https://dash.akamaized.net/akamai/test/caption_test/ElephantsDream/elephants_dream_480p_heaac5_1_https.mpd",
video = video = document.querySelector('video'),
player;
player = dashjs.MediaPlayer({}).create();
player.initialize(video, url, true);
}
</script>
</head>
<body>
<video
id="my-player"
class="video-js"
controls
preload="auto"
poster="//vjs.zencdn.net/v/oceans.png"
data-setup='{}'>
<source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source>
<source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"></source>
<source src="//vjs.zencdn.net/v/oceans.ogv" type="video/ogg"></source>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">
supports HTML5 video
</a>
</p>
</video>
<video
id="my-video"
class="video-js vjs-default-skin"
controls
preload="auto"
width="560"
height="300"
data-setup='{}'>
<source
src="https://vjs.zencdn.net/v/oceans.mp4"
type="video/mp4"
size="1080"
>
<track
kind="subtitles"
src="https://gist.githubusercontent.com/samdutton/ca37f3adaf4e23679957b8083e061177/raw/e19399fbccbc069a2af4266e5120ae6bad62699a/sample.vtt"
srclang="en"
label="English"
>
</video>
</body>
<html>
Start-Sleep -Seconds 3
[System.Windows.Forms.SendKeys]::SendWait("^+{F10}")
[System.Windows.Forms.SendKeys]::SendWait("e")
CTRL + E----- To merge two cells
ALT + H +O +I ----------- Column width Auto size
ALT +H + W or ALT + H + O +A ---------- Auto size column height
#Context menu with Powershell
[System.Windows.Forms.SendKeys]::SendWait("^+{F10}")
Shift + F10
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName Microsoft.VisualBasic
Start-Process -FilePath "explorer.exe"
# Wait for WinWord to open and become active
Start-Sleep -Seconds 1
(New-Object -ComObject "wscript.shell").SendKeys("^{l}")
Start-Sleep -Seconds 1
(New-Object -ComObject "wscript.shell").SendKeys("D:\")
Start-Sleep -Seconds 1
(New-Object -ComObject "wscript.shell").SendKeys("{Enter}")
#Context menu with Powershell
[System.Windows.Forms.SendKeys]::SendWait("^+{F10}")
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait("^+n")
Start-Sleep -Seconds 1
(New-Object -ComObject "wscript.shell").SendKeys("{Enter}")
#Note This first line is mandatory
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
# Start WinWord (if not already running)
Start-Process -FilePath "excel.exe"
# Wait for WinWord to open and become active
Start-Sleep -Seconds 3
# Activate the WinWord window (adjust the title if necessary)
$wshell = New-Object -ComObject wscript.shell
#$wshell.AppActivate("Document1 - Word") # Or the actual document title
Start-Sleep -Seconds 1
for ($i = 1; $i -le 5; $i++) {
$j = [char](65 + $i)
[System.Windows.Forms.SendKeys]::SendWait("$j")
}
or
for ($test = 0; $test -lt 26; $test++)
{
[char](65 + $test)
}
>click on Start button
> Type Printers and scanners
>Select printer(Printer that you work like HP or Other) and Manage
> Click on Open Print Queue
> Click on Printer And Click on pause Printing(Check and Uncheck for Printing)
# Load the necessary assemblies for accessing mouse position information
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
Write-Host "Move your mouse. Press Ctrl+C to stop."
while ($true) {
# Get the current mouse position
$cursorPosition = [System.Windows.Forms.Cursor]::Position
$x = $cursorPosition.X
$y = $cursorPosition.Y
# Print the coordinates. Using Write-Host with -NoNewline and carriage return `r`
# overwrites the previous line in the console for a cleaner continuous update.
Write-Host "`rX: $x | Y: $y" -NoNewline
# Wait for a short period to prevent the loop from consuming too much CPU
Start-Sleep -Milliseconds 100
}
or for single position
Add-Type -AssemblyName System.Windows.Forms
$mousePosition = [System.Windows.Forms.Cursor]::Position
Write-Host "Current mouse position is X: $($mousePosition.X), Y: $($mousePosition.Y)"
for ($i = 100; $i -ge 10; $i--) {
Start-Sleep -Milliseconds 1
Write-Host "Iteration: $i"
[System.Windows.Forms.Cursor]::Position = "$i, $i "
}
or with 10 decrement
for ($i = 1000; $i -ge 10; $i -= 10) {
Start-Sleep -Milliseconds 1
Write-Host "Iteration: $i"
[System.Windows.Forms.Cursor]::Position = "$i, $i "
}
[System.Windows.Forms.Cursor]::Position = "700,700"
Add-Type –AssemblyName UIAutomationClient
Add-Type –AssemblyName UIAutomationTypes
$calc = [Diagnostics.Process]::Start('calc')
#wait for the UI to appear
$null = $calc.WaitForInputIdle(5000)
sleep –s 2
$calcWindowId = ((Get-Process).where{$_.MainWindowTitle -eq 'Calculator'})[0].Id
$root = [Windows.Automation.AutomationElement]::RootElement
$condition = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::ProcessIdProperty, $calcWindowId)
$calcUI = $root.FindFirst([Windows.Automation.TreeScope]::Children, $condition)
function FindAndClickButton($name){
$condition1 = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::ClassNameProperty, "Button")
$condition2 = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::NameProperty, $name)
$condition = New-Object Windows.Automation.AndCondition($condition1, $condition2)
$button = $calcUI.FindFirst([Windows.Automation.TreeScope]::Descendants, $condition)
$button.GetCurrentPattern([Windows.Automation.InvokePattern]::Pattern).Invoke()
}
#get and click the buttons for the calculation
FindAndClickButton Five
FindAndClickButton Plus
FindAndClickButton Nine
FindAndClickButton Equals
#get the result
$condition = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::AutomationIdProperty, "CalculatorResults")
$result = $calcUI.FindFirst([Windows.Automation.TreeScope]::Descendants, $condition)
$result.current.name
Sub CommandButton1_Click()
Shell "Notepad.exe", vbNormalFocus
Dim I As Integer
SendKeys "one"
SendKeys "{Enter}"
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys "^a"
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys "^c"
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys "{right}"
Application.Wait (Now + TimeValue("00:00:01"))
SendKeys "two"
Application.Wait (Now + TimeValue("00:00:01"))
End Sub
Sub SendAlphabet_AtoZ()
Shell "Notepad.exe", vbNormalFocus
Dim i As Integer
Dim char_code As Integer
Dim current_char As String
Dim row_num As Integer
Dim z As Integer
For z = 1 To 50
row_num = 1
' Loop through ASCII codes for lowercase 'a' (97) to 'z' (122)
For char_code = 50 To 122
' Convert the ASCII code to a character
current_char = Chr(char_code)
Application.Wait (Now + TimeValue("00:00:00"))
' Place the character in the active worksheet in column A
SendKeys current_char
' Move to the next row
Next char_code
Next z
End Sub
Start-Sleep -Seconds 5
$wshell = New-Object -ComObject WScript.Shell
$wshell.SendKeys("^{F4}")
or
#Note This first line is mandatory
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
# Start WinWord (if not already running)
Start-Process -FilePath "explorer.exe"
# Wait for WinWord to open and become active
Start-Sleep -Seconds 3
(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")
# Activate the WinWord window (adjust the title if necessary)
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
https://stackoverflow.com/questions/19824799/how-can-i-send-ctrl-or-alt-any-other-key
=Countif('SheetName'!I3:I998, "Open")
I3:I998 is range