<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>SumTips</title>
	<atom:link href="https://sumtips.com/feed/?cat=-11" rel="self" type="application/rss+xml" />
	<link>https://sumtips.com/</link>
	<description>SumTips makes your computing easy with helpful tips, software reviews, tutorials and latest news</description>
	<lastBuildDate>Thu, 07 Dec 2023 15:21:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/sumtips.com/wp-content/uploads/2018/07/cropped-SumTips-Favico.png?fit=32%2C32&#038;ssl=1</url>
	<title>SumTips</title>
	<link>https://sumtips.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Refreshing Excel Data Automatically Using PowerShell</title>
		<link>https://sumtips.com/snippets/powershell/refresh-excel-data-automatically-powershell/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Thu, 07 Dec 2023 15:21:24 +0000</pubDate>
				<category><![CDATA[PowerShell Snippets]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">https://sumtips.com/?p=9565</guid>

					<description><![CDATA[Learn how to automate data refresh with PowerShell. Timesaving, efficient, and a game-changer for spreadsheet aficionados. <div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/" rel="bookmark" title="Effortless File Organization: Automating File Copy with PowerShell and Excel">Effortless File Organization: Automating File Copy with PowerShell and Excel</a></li>
<li><a href="https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/" rel="bookmark" title="How to Protect Excel Cell Format, Formula, Content &#038; Structure">How to Protect Excel Cell Format, Formula, Content &#038; Structure</a></li>
<li><a href="https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/" rel="bookmark" title="How to Add Custom File Types to Excel Open File Dialog">How to Add Custom File Types to Excel Open File Dialog</a></li>
<li><a href="https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/" rel="bookmark" title="PowerShell: Automatically Cycle Through Tabs in Any Browser">PowerShell: Automatically Cycle Through Tabs in Any Browser</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>In this post, we will be looking at a handy script designed to refresh external data connections in Excel. If you&#8217;ve ever found yourself drowning in outdated data or wished for a more efficient way to keep your spreadsheets up to date, you&#8217;re in for a treat. Let&#8217;s dive into the script step by step and unveil the magic of automation.</p>
<pre class="prettyprint">#Refresh Excel External Data with PowerShell

# Define the path to the Excel file
$excelFilePath = &#x22;C:\Files\ExcelRefresh.xlsx&#x22;

# Set the visibility of the Excel application to false (invisible)
$visible = $false

# Create a new Excel application object
$excelApp = New-Object -ComObject &#x22;Excel.Application&#x22;

# Set the application to be invisible
$excelApp.Visible = $visible

# Open the specified workbook
$workbook = $excelApp.Workbooks.Open($excelFilePath)

# Refresh all external data connections
$workbook.RefreshAll()

# Disables pop-up alerts or messages while interacting with the workbook
$workbook.DisplayAlerts = $false

# Hides the workbook from view
$workbook.Visible = $false

# Save the workbook
$workbook.Save()

# Close the workbook and quit the application
$workbook.Close()
$excelApp.Quit()

# Release COM objects
Remove-Variable excelApp, workbook</pre>
<h3>Script walkthrough:</h3>
<p><strong>Step 1: Define the Excel File Path</strong></p>
<pre class="prettyprint"># Define the path to the Excel file
$excelFilePath = &#x22;C:\Files\ExcelRefresh.xlsx&#x22;</pre>
<p>Here, we start by specifying the path to our Excel file. Make sure to replace this with the path to your own workbook.</p>
<p><strong>Step 2: Set Excel Application Visibility</strong></p>
<pre class="prettyprint"># Set the visibility of the Excel application to false (invisible)
$visible = $false</pre>
<p>This line determines whether Excel will be visible during the process. Setting it to $false makes it run in the background without distracting pop-ups.</p>
<p><strong>Step 3: Create Excel Application Object</strong></p>
<pre class="prettyprint"># Create a new Excel application object
$excelApp = New-Object -ComObject &#x22;Excel.Application&#x22;</pre>
<p>With this line, we create a new instance of the Excel application, essentially opening Excel programmatically.</p>
<p><strong>Step 4: Set Application Visibility</strong></p>
<pre class="prettyprint"># Set the application to be invisible
$excelApp.Visible = $visible</pre>
<p>Here, we use the visibility variable we defined earlier to set whether Excel should be visible to the user or not.</p>
<p><strong>Step 5: Open Workbook and Refresh Data</strong></p>
<pre class="prettyprint"># Open the specified workbook
$workbook = $excelApp.Workbooks.Open($excelFilePath)

# Refresh all external data connections
$workbook.RefreshAll()</pre>
<p>We open the workbook specified in the file path and trigger a refresh for all external data connections.</p>
<p><strong>Step 6: Disable Alerts and Hide Workbook</strong></p>
<pre class="prettyprint"># Disables pop-up alerts or messages while interacting with the workbook
$workbook.DisplayAlerts = $false

# Hides the workbook from view
$workbook. Visible = $false</pre>
<p>To avoid interruptions, we disable any alerts and keep the workbook hidden.</p>
<p><strong>Step 7: Save Changes</strong></p>
<pre class="prettyprint"># Save the workbook
$workbook. Save()</pre>
<p>Ensuring any changes made during the refresh are saved.</p>
<p><strong>Step 8: Close Workbook and Quit Application</strong></p>
<pre class="prettyprint"># Close the workbook and quit the application
$workbook. Close()
$excelApp.Quit()</pre>
<p>Finally, we gracefully close the workbook and quit the Excel application.</p>
<p><strong>Step 9: Release COM Objects</strong></p>
<pre class="prettyprint"># Release COM objects
Remove-Variable excelApp, workbook</pre>
<p>To clean up, we release the COM objects, ensuring no memory leaks.</p>
<p>By following these steps, you&#8217;ve successfully automated the process of refreshing external data connections in Excel using PowerShell. This script is a time-saver, especially for those dealing with frequently updated data.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/snippets/powershell/refresh-excel-data-automatically-powershell/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/snippets/powershell/refresh-excel-data-automatically-powershell/ - Refreshing Excel Data Automatically Using PowerShell"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/snippets/powershell/refresh-excel-data-automatically-powershell/&t=Refreshing Excel Data Automatically Using PowerShell"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/" rel="bookmark" title="Effortless File Organization: Automating File Copy with PowerShell and Excel">Effortless File Organization: Automating File Copy with PowerShell and Excel</a></li>
<li><a href="https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/" rel="bookmark" title="How to Protect Excel Cell Format, Formula, Content &#038; Structure">How to Protect Excel Cell Format, Formula, Content &#038; Structure</a></li>
<li><a href="https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/" rel="bookmark" title="How to Add Custom File Types to Excel Open File Dialog">How to Add Custom File Types to Excel Open File Dialog</a></li>
<li><a href="https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/" rel="bookmark" title="PowerShell: Automatically Cycle Through Tabs in Any Browser">PowerShell: Automatically Cycle Through Tabs in Any Browser</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Effortless File Organization: Automating File Copy with PowerShell and Excel</title>
		<link>https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Thu, 07 Dec 2023 12:28:24 +0000</pubDate>
				<category><![CDATA[PowerShell Snippets]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">https://sumtips.com/?p=9558</guid>

					<description><![CDATA[This script copies files from one folder to separate folders at a different location based on information provided in an Excel workbook<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/snippets/powershell/powershell-sort-files-into-folders-based-on-filename/" rel="bookmark" title="PowerShell: Sort Files Into Folders Based on Filename">PowerShell: Sort Files Into Folders Based on Filename</a></li>
<li><a href="https://sumtips.com/how-to/create-folder-list-copy-file-folder-name-context-menu/" rel="bookmark" title="Add Create Folder List, Copy File/Folder Name to Explore Context Menu">Add Create Folder List, Copy File/Folder Name to Explore Context Menu</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/delete-files-older-than-x-days-in-windows-powershell-command-prompt/" rel="bookmark" title="Delete Files Older Than X Days in Windows with PowerShell &#038; CMD">Delete Files Older Than X Days in Windows with PowerShell &#038; CMD</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>Are you tired of manually managing your files and folders? In this article, we&#8217;ll explore a straightforward PowerShell script designed to streamline your file organization process. This script copies files from one folder to separate folders at a different location based on information provided in an Excel workbook:</p>
<pre class="prettyprint"># Define source and destination folders, and Excel file path.
$sourceFolder = &#x22;C:\SourceFolder&#x22;
$destinationFolder = &#x22;C:\DestinationFolder&#x22;
$excelPath = &#x22;C:\File_List.xlsx&#x22;

# Import Excel data into a PowerShell object.
$excelData = Import-Excel -Path $excelPath

# Create dictionary to track copied files and avoid duplicates.
$copiedFiles = @{}

# Loop through each file in the source folder.
Get-ChildItem -Path $sourceFolder -File | ForEach-Object {
  # Get the base name (excluding extension) and full name (including extension) of the file.
  $fileName = $_.BaseName
  $fullName = $_.Name

  # Skip already copied files, checking both base and full name for duplicates.
  if ($copiedFiles[$fileName] -or $copiedFiles[$fullName]) {
    Write-Host &#x22;Skipping &#x27;$fullName&#x27; as it has already been copied.&#x22;
    continue
  }

  # Check if a corresponding entry exists in Excel data, searching for either base or full name.
  $fileEntry = $excelData | Where-Object { $_.&#x27;Column1&#x27; -eq $fileName -or $_.&#x27;Column1&#x27; -eq $fullName }

  if ($fileEntry) {
    # Extract associated items from the &#x22;Column2&#x22; in Excel data.
    $items = $fileEntry.&#x27;Column2&#x27;

    # Create individual folders for each associated item.
    foreach ($item in $items) {
      # Create the target folder path.
      $targetFolder = Join-Path -Path $destinationFolder -ChildPath $item
      New-Item -Path $targetFolder -ItemType Directory -Force -ErrorAction SilentlyContinue

      # Copy the file to each item&#x27;s folder.
      $destinationPath = Join-Path -Path $targetFolder -ChildPath $fullName
      Copy-Item -Path $_.FullName -Destination $destinationPath -ErrorAction SilentlyContinue
    }
  }

  # Mark both the base name and full name as copied to avoid duplicates.
  $copiedFiles[$fileName] = $true
  $copiedFiles[$fullName] = $true
}

Write-Host &#x22;Finished copying files.&#x22;</pre>
<p>Let&#8217;s break down the code step by step to understand how it works.<br />
<strong>Setting the Stage: Defining Paths</strong></p>
<pre class="prettyprint"># Define source and destination folders, and Excel file path.
$sourceFolder = &#x22;C:\SourceFolder&#x22;
$destinationFolder = &#x22;C:\DestinationFolder&#x22;
$excelPath = &#x22;C:\Workbook.xlsx&#x22;</pre>
<p>Here, we set up the source folder containing our files, the destination folder where we want to organize them, and the path to an Excel workbook that holds our organizational data.</p>
<pre class="prettyprint"># Import Excel data into a PowerShell object.
$excelData = Import-Excel -Path $excelPath</pre>
<p>We import data from the Excel workbook into a PowerShell object, allowing us to leverage it for efficient file management.</p>
<p><strong>Avoiding Chaos: Preventing Duplicates</strong></p>
<pre class="prettyprint"># Create dictionary to track copied files and avoid duplicates.
$copiedFiles = @{}</pre>
<p>To ensure an organized system, we create a dictionary named $copiedFiles to keep track of files that have already been copied, preventing duplication.</p>
<p><strong>The Main Act: File Looping and Copying</strong></p>
<pre class="prettyprint"># Loop through each file in the source folder.
Get-ChildItem -Path $sourceFolder -File | ForEach-Object {
    # Get the base name and full name of the file.
    $fileName = $_.BaseName
    $fullName = $_.Name

    # Skip already copied files.
    if ($copiedFiles[$fileName] -or $copiedFiles[$fullName]) {
        Write-Host &#x22;Skipping &#x27;$fullName&#x27; as it has already been copied.&#x22;
        continue
    }

    # Check for a corresponding entry in Excel data.
    $fileEntry = $excelData | Where-Object { $_.&#x27;Column1&#x27; -eq $fileName -or $_.&#x27;Column1&#x27; -eq $fullName }

    if ($fileEntry) {
        # Extract associated items from &#x22;Column2&#x22; in Excel data.
        $items = $fileEntry.&#x27;Column2&#x27;

        # Create folders for each associated item.
        foreach ($item in $items) {
            $targetFolder = Join-Path -Path $destinationFolder -ChildPath $item
            New-Item -Path $targetFolder -ItemType Directory -Force -ErrorAction SilentlyContinue

            # Copy the file to each item&#x27;s folder.
            $destinationPath = Join-Path -Path $targetFolder -ChildPath $fullName
            Copy-Item -Path $_.FullName -Destination $destinationPath -ErrorAction SilentlyContinue
        }
    }

    # Mark both base name and full name as copied to avoid duplicates.
    $copiedFiles[$fileName] = $true
    $copiedFiles[$fullName] = $true
}</pre>
<p>Here, the script iterates through each file in the source folder, checks for duplicates, and copies files to specified folders based on Excel data. The process ensures a well-organized destination folder.</p>
<p><strong>Curtain Call: Finishing Touches</strong></p>
<pre class="prettyprint">Write-Host "Finished copying files."</pre>
<p>The script concludes by letting you know that the file copying process is complete. With this PowerShell script, you can efficiently manage and organize your files, saving time and effort in your daily workflow.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/ - Effortless File Organization: Automating File Copy with PowerShell and Excel"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/snippets/powershell/automating-file-copy-with-powershell-and-excel/&t=Effortless File Organization: Automating File Copy with PowerShell and Excel"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/snippets/powershell/powershell-sort-files-into-folders-based-on-filename/" rel="bookmark" title="PowerShell: Sort Files Into Folders Based on Filename">PowerShell: Sort Files Into Folders Based on Filename</a></li>
<li><a href="https://sumtips.com/how-to/create-folder-list-copy-file-folder-name-context-menu/" rel="bookmark" title="Add Create Folder List, Copy File/Folder Name to Explore Context Menu">Add Create Folder List, Copy File/Folder Name to Explore Context Menu</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/delete-files-older-than-x-days-in-windows-powershell-command-prompt/" rel="bookmark" title="Delete Files Older Than X Days in Windows with PowerShell &#038; CMD">Delete Files Older Than X Days in Windows with PowerShell &#038; CMD</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Add Custom File Types to Excel Open File Dialog</title>
		<link>https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Sun, 16 Sep 2018 17:39:08 +0000</pubDate>
				<category><![CDATA[How To?]]></category>
		<category><![CDATA[Macro]]></category>
		<category><![CDATA[Microsoft Excel]]></category>
		<category><![CDATA[Office]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=7777</guid>

					<description><![CDATA[Learn how to customize Microsoft Excel's File Open dialog to show only specific file types using VB Macro. This custom filter would be available on all new sheets.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/" rel="bookmark" title="Convert Excel Cell Contents to Comments and vice-versa with VBA Code">Convert Excel Cell Contents to Comments and vice-versa with VBA Code</a></li>
<li><a href="https://sumtips.com/software/disguise-twitter-as-excel-spreadsheet/" rel="bookmark" title="Disguise Twitter as an Excel Spreadsheet">Disguise Twitter as an Excel Spreadsheet</a></li>
<li><a href="https://sumtips.com/snippets/wordpress/include-page-custom-post-type-wordpress-feed/" rel="bookmark" title="Add Pages, Custom Post Types in WordPress Site Feed">Add Pages, Custom Post Types in WordPress Site Feed</a></li>
<li><a href="https://sumtips.com/software/identify-unknown-file-smart-file/" rel="bookmark" title="Identify Unknown File Types with Smart File Advisor">Identify Unknown File Types with Smart File Advisor</a></li>
<li><a href="https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/" rel="bookmark" title="How to Protect Excel Cell Format, Formula, Content &#038; Structure">How to Protect Excel Cell Format, Formula, Content &#038; Structure</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>When you press <kb>Ctrl</kb> + <kb>O</kb> in Excel, by default it would list all Excel file types in the folder. This setting works perfectly fine for most users. However, if your work involves other file types, say CSV(comma-separated values). You would have to click on the file filter dropdown and select &#8220;Text Files (*.prn;*.txt;*.csv)&#8221; from the list.</p>
<p>We can save these additional clicks by using a VB Macro to see only those file types which we want as in the image below.</p>
<p><img fetchpriority="high" decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-oLRAB_tz_iQ/W55Q1xRrC_I/AAAAAAAChlI/JlYcIsW3798AMCVV0P5Fy174sg4qKM0TgCLcBGAs/s1600/custom-excel-file-open.png?resize=946%2C533&#038;ssl=1" width="946" height="533" alt="Custom Excel File Open dialog" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>Follow below steps to set this up:<br />
1. Launch Microsoft Excel > Create a new document.<br />
2. Navigate to Developer tab > Click on Visual Basic, or just press <kb>Alt</kb> + <kb>F11</kb> on your keyboard.<br />
3. In the project panel, double-click on &#8220;ThisWorkbook&#8221; under VBAProject. Now, paste below code in to the Editor: </p>
<pre class="prettyprint">Sub CustomFileOpen()
Dim strFileToOpen As String

strFileToOpen = Application.GetOpenFilename( _
                FileFilter:=&#x22;Spreadsheets (*.xl* ; *.ods; *.csv),*.xl; *.ods; *.csv&#x22;, _
                Title:=&#x22;Select Spreadsheet to Open&#x22;)
End Sub</pre>
<p>4. Switch back to Excel > Press <kb>Alt</kb> + <kb>F8</kb>. This should open &#8220;Macro&#8221; dialog.<br />
5. With &#8220;ThisWorkbook.CustomFileOpen&#8221; selected > Click Options and set up a hotkey to run this macro. For a familiar usage, you can set <kb>Ctrl</kb> + <kb>O</kb> as the shortcut.</p>
<p>Finally, to see if the code is working, switch back to Excel and press <kb>Ctrl</kb> + <kb>O</kb>. That should pop-up the Open File dialog.</p>
<p>In this script, we have made two changes to the dialog:<br />
1. Changed the dialog title to &#8220;Select Spreadsheet to Open.&#8221;<br />
2. Added filter to display all Excel files, OpenDocument Spreadsheet (.ods), and Comma-separated values (.csv) files.</p>
<p>You can further tweak the script to include or exclude any file type you want by editing the fifth line.</p>
<p><strong>Tip:</strong><strong></strong> To make this macro available by default in all Excel Sheets, save the code in a workbook called &#8220;Personal.xlsb&#8221; in your XLSTART folder. This folder is located at: <code>C:\Users\<strong>UserName</strong>\AppData\Roaming\Microsoft\Excel\XLSTART</code>. Replace &#8220;UserName&#8221; in the path with your own Windows username.</p>
<p>That&#8217;s all.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/ - How to Add Custom File Types to Excel Open File Dialog"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/how-to/add-custom-file-types-excel-open-file-dialog/&t=How to Add Custom File Types to Excel Open File Dialog"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/" rel="bookmark" title="Convert Excel Cell Contents to Comments and vice-versa with VBA Code">Convert Excel Cell Contents to Comments and vice-versa with VBA Code</a></li>
<li><a href="https://sumtips.com/software/disguise-twitter-as-excel-spreadsheet/" rel="bookmark" title="Disguise Twitter as an Excel Spreadsheet">Disguise Twitter as an Excel Spreadsheet</a></li>
<li><a href="https://sumtips.com/snippets/wordpress/include-page-custom-post-type-wordpress-feed/" rel="bookmark" title="Add Pages, Custom Post Types in WordPress Site Feed">Add Pages, Custom Post Types in WordPress Site Feed</a></li>
<li><a href="https://sumtips.com/software/identify-unknown-file-smart-file/" rel="bookmark" title="Identify Unknown File Types with Smart File Advisor">Identify Unknown File Types with Smart File Advisor</a></li>
<li><a href="https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/" rel="bookmark" title="How to Protect Excel Cell Format, Formula, Content &#038; Structure">How to Protect Excel Cell Format, Formula, Content &#038; Structure</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Protect Excel Cell Format, Formula, Content &#038; Structure</title>
		<link>https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Sun, 16 Sep 2018 15:30:18 +0000</pubDate>
				<category><![CDATA[How To?]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Microsoft Excel]]></category>
		<category><![CDATA[Office]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=7864</guid>

					<description><![CDATA[Learn how to allow customized data entry in specific cells in Excel, and protect formulas, workbook structure and entire spreadsheet from unwanted users.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/" rel="bookmark" title="Convert Excel Cell Contents to Comments and vice-versa with VBA Code">Convert Excel Cell Contents to Comments and vice-versa with VBA Code</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/google-docs-import-data-from-one-spreadsheet-into-another/" rel="bookmark" title="Google Docs: Import Data from One Spreadsheet into Another">Google Docs: Import Data from One Spreadsheet into Another</a></li>
<li><a href="https://sumtips.com/software/browsers/password-protect-firefox-bookmarks-link/" rel="bookmark" title="Password Protect Firefox Bookmarks with Link Password">Password Protect Firefox Bookmarks with Link Password</a></li>
<li><a href="https://sumtips.com/software/windows-how-to-copy-folder-structure-without-copying-files/" rel="bookmark" title="Windows: How to Copy Folder Structure without Copying Files">Windows: How to Copy Folder Structure without Copying Files</a></li>
<li><a href="https://sumtips.com/how-to/customize-native-wordpress-shortlink-url-structure/" rel="bookmark" title="Customize Native WordPress Shortlink URL Structure">Customize Native WordPress Shortlink URL Structure</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>Spreadsheets often contain important data, so it could be crucial to lock the document before sharing to make sure that it&#8217;s not misused. However, there are times when you may want the end user to enter some data in the shared file. Luckily, Excel has built-in features that allows us to fine tune workbook protection just the way we want it.<br />
<img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-OmKATTgB7sA/W54nU-_OqZI/AAAAAAAChkQ/h-d-vbuLkcc48FMTmfGHXdLdfy85GbKOQCLcBGAs/s1600/excel-protect.png?resize=980%2C551&#038;ssl=1" width="980" height="551" alt="Protect Excel" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>In this post, we&#8217;ll be covering the following options:</p>
<ul>
<li>Allow Data Entry Only in Specific Cells in Excel</li>
<li>Lock and Hide Formulas in Excel</li>
<li>Protect Structure of an Excel Worksheet</li>
<li>Mark Excel Workbook as Final</li>
<li>Password Protect an Entire Excel Workbook File</li>
</ul>
<h3>How to Allow Data Entry Only in Specific Cells in Excel</h3>
<p>We&#8217;ll start off by learning how to allow editing of specific cells in Excel, while all other cells remain locked and protected. This would also protect formatting of the cells you select while the users can add/edit content in the them.<br />
<img decoding="async" src="https://i0.wp.com/1.bp.blogspot.com/-sc3VVQcxKt0/W54nT-48KnI/AAAAAAAChkM/CsjHgHMs8CkzF3sxoKGRmTblITa3_YicQCLcBGAs/s1600/excel-cell-unlock.png?resize=980%2C551&#038;ssl=1" width="980" height="551" alt="How to Allow Data Entry in Specific Cells in Excel" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p><strong>Steps:</strong><br />
1. With the workbook open, select the cells you want to be editable.<br />
2. Press <kb>Ctrl</kb> + <kb>1</kb> to open &#8220;Format Cells&#8221; dialog.<br />
3. Switch to &#8220;Protection&#8221; tab in the dialog > Uncheck the &#8220;Locked&#8221; box, and then click the &#8220;OK&#8221; button.<br />
4. Now go to &#8220;Review&#8221; tab > &#8220;Protect Sheet.&#8221;<br />
5. Type-in a password to protect the sheet > Click &#8220;OK.&#8221; Password is optional.<br />
<img loading="lazy" decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-V4HVu9j4DwE/W54sz1bC20I/AAAAAAAChk4/3hytGFz2NQ0Isx-bnLJNZPol22xbOGNEgCLcBGAs/s1600/excel-protect-sheet.png?resize=274%2C378&#038;ssl=1" width="274" height="378" alt="Excel Protect Sheet options" class="alignright size-medium" data-recalc-dims="1" /><br />
That&#8217;s it. The worksheet is now protected, but the end user can still make modifications in the cells you have allowed them.</p>
<p>The pop-up dialog we saw in Step 3, allows even further fine-tuning of cell protection. For example, you can allow users to format cells without modifying the original content, or perhaps you can allow end users to insert additional rows and columns but not remove the original cells. These options can be achieved by customizing the selection in &#8220;Protect Sheet&#8221; dialog.</p>
<p>To unprotect a locked sheet, simply go to Review tab and click on &#8220;Unprotect Sheet.&#8221; If you had locked with a password, re-enter the password as well to remove the protection.</p>
<h3>How to Lock and Hide Formulas in Excel</h3>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-DkwY5TnrlnY/W54nTg7DJVI/AAAAAAAChkE/b0YqDstByT0N7dBhccyjiEDdA3n29W0eACLcBGAs/s1600/excel-formula-hide.png?resize=980%2C551&#038;ssl=1" width="980" height="551" alt="How to Lock and Hide Formulas in Excel" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>While sharing a spreadsheet, if you do not wish the end user to be able to view or edit the formulas used, you can hide them from appearing in the Formula Bar. Let&#8217;s look at how to achieve this.</p>
<p><strong>Steps:</strong><br />
1. With the workbook open, select the cells containing the formula.<br />
2. Press <kb>Ctrl</kb>+<kb>1</kb> to open Format Cells dialog.<br />
3. Switch to Protection tab in the dialog > Check the &#8220;Locked&#8221; and &#8220;Hidden&#8221; box, and then click the OK button.<br />
4. Now go to Review tab > Protect Sheet.<br />
5. Type-in a password to protect the sheet > Click OK.</p>
<p>You can allow users to enter data in other cells following the previous instructions.</p>
<h3>How to Protect Structure of an Excel Worksheet</h3>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-QzR1ftzaLIo/W54nVDLSDjI/AAAAAAAChkY/PDeYj1-f3nEqB839eMIBXsfP4JJqEuyTACLcBGAs/s1600/excel-structure.png?resize=914%2C514&#038;ssl=1" width="914" height="514" alt="How to Protect Structure of an Excel Worksheet" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>Now, let&#8217;s look at how we can protect the structure of an Excel workbook. With this enabled, the end user will not be able to add, delete, hide, unhide, or re-arrange sheets inside of the workbook. Follow these steps to enable &#8220;Protect Structure and Windows&#8221; protection:</p>
<p><strong>Steps:</strong><br />
1. Open the Workbook you wish to protect.<br />
2. Navigate to Review tab > Click on Protect Workbook.<br />
3. Enter a password > Check the box for &#8220;Structure&#8221; > Click OK.</p>
<p>That&#8217;s it. The document is now protected.</p>
<p>To unprotect the workbook, simply click on the Protect Workbook button again and input the password.</p>
<h3>How to Mark Excel Workbook as Final</h3>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/4.bp.blogspot.com/-EkXaUMdXrls/W54nTtITPyI/AAAAAAAChkI/G-NXSpksp1EOnaBCgX0HPu5TcuaO8985ACLcBGAs/s1600/excel-mark-as-final.png?resize=660%2C371&#038;ssl=1" width="660" height="371" alt="How to Mark Excel Workbook as Final" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>The &#8220;Mark as Final&#8221; feature allows you to mark an Excel file as the final version. When this is enabled, the file switches to read-only mode, and the end user will have to re-enable editing if they wish to make edits. On opening the file, a soft warning is displayed at the top of the file as seen in the image above.</p>
<p><strong>Steps:</strong><br />
1. Open the Workbook you wish to finalize.<br />
2. Navigate to File tab > Choose Info tab.<br />
3. Click on the Protect Workbook dropdown and choose Mark as Final.<br />
4. You will get a prompt now > Confirm it and save the file.</p>
<h3>How to Password Protect an Entire Excel Workbook File</h3>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/1.bp.blogspot.com/-orcOd8z92ws/W54nU6R5paI/AAAAAAAChkU/ipm5k_ZIvpU3nmRUpxUcT11gCiP8Z0S3QCLcBGAs/s1600/excel-password.png?resize=801%2C451&#038;ssl=1" width="801" height="451" alt="How to Password Protect an Excel Workbook File" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<p>Now, finally let&#8217;s look at how to protect an entire spreadsheet with a password to prevent others from opening it.</p>
<p><strong>Steps:</strong><br />
1. Open the Workbook you wish to protect.<br />
2. Navigate to File tab > Choose Info tab.<br />
3. Click on the Protect Workbook dropdown and choose Encrypt with Password.<br />
4. Type-in a password > Re-confirm it and click OK.</p>
<p>That&#8217;s all. Hope these tips help you in becoming an advanced Excel user and in protecting your data. <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/ - How to Protect Excel Cell Format, Formula, Content &#038; Structure"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/how-to/protect-excel-cell-formatting-content-structure-formula/&t=How to Protect Excel Cell Format, Formula, Content &#038; Structure"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/tips-n-tricks/convert-excel-cell-contents-comments-vba/" rel="bookmark" title="Convert Excel Cell Contents to Comments and vice-versa with VBA Code">Convert Excel Cell Contents to Comments and vice-versa with VBA Code</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/google-docs-import-data-from-one-spreadsheet-into-another/" rel="bookmark" title="Google Docs: Import Data from One Spreadsheet into Another">Google Docs: Import Data from One Spreadsheet into Another</a></li>
<li><a href="https://sumtips.com/software/browsers/password-protect-firefox-bookmarks-link/" rel="bookmark" title="Password Protect Firefox Bookmarks with Link Password">Password Protect Firefox Bookmarks with Link Password</a></li>
<li><a href="https://sumtips.com/software/windows-how-to-copy-folder-structure-without-copying-files/" rel="bookmark" title="Windows: How to Copy Folder Structure without Copying Files">Windows: How to Copy Folder Structure without Copying Files</a></li>
<li><a href="https://sumtips.com/how-to/customize-native-wordpress-shortlink-url-structure/" rel="bookmark" title="Customize Native WordPress Shortlink URL Structure">Customize Native WordPress Shortlink URL Structure</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Assign Keyboard Shortcut to Pin Tab in Browsers</title>
		<link>https://sumtips.com/how-to/assign-keyboard-shortcut-pin-unpin-tab/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Thu, 13 Sep 2018 05:35:23 +0000</pubDate>
				<category><![CDATA[How To?]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Opera]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=8520</guid>

					<description><![CDATA[Here's how you can assign a keyboard shortcut to toggle pin/unpin status of browser tabs on Google Chrome, Mozilla Firefox, and Opera browsers.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/software/browsers/edit-default-chrome-keyboard-shortcuts/" rel="bookmark" title="Edit Default Google Chrome Keyboard Shortcuts, or Create Custom Ones">Edit Default Google Chrome Keyboard Shortcuts, or Create Custom Ones</a></li>
<li><a href="https://sumtips.com/software/browsers/how-to-close-duplicate-tabs-in-chrome-and-firefox/" rel="bookmark" title="How to Close Duplicate Tabs in Chrome and Firefox">How to Close Duplicate Tabs in Chrome and Firefox</a></li>
<li><a href="https://sumtips.com/how-to/enable-do-not-track-on-all-popular-browsers/" rel="bookmark" title="Activate Do Not Track on All Browsers">Activate Do Not Track on All Browsers</a></li>
<li><a href="https://sumtips.com/software/browsers/backup-and-restore-all-browsers-in-3/" rel="bookmark" title="Backup and Restore All Browsers in 3 Steps">Backup and Restore All Browsers in 3 Steps</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/abort-windows-shutdown-with-create/" rel="bookmark" title="Abort Windows Shutdown with a Keyboard Shortcut">Abort Windows Shutdown with a Keyboard Shortcut</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>If you are someone who works with a specific set of websites, there&#8217;s a good chance you have them pinned on your favorite browser. Pinning tabs has several benefits, including automatically opening websites on starting the browser, saving tab-strip space for other websites, and it also prevents accidental closing of important websites.</p>
<p>On most browsers, to pin a website, you just have to right-click on the website&#8217;s tab and select &#8220;Pin Tab.&#8221; If you regularly pin and unpin tabs, or if you primarily work on a laptop, using a quick keyboard shortcut to pin and unpin websites can be a real time and effort saver.</p>
<h2>Assign Keyboard Shortcut to Pin Browser Tabs</h2>
<p>In this post, we will be looking at how we can add a keyboard shortcut functionality to pin or unpin a website on Google Chrome, Mozilla Firefox, and Opera. These browsers do not have a built-in option to assign hotkeys to toggle pin/unpin tabs, but thankfully, there are browsers extensions to help us out here.</p>
<h3>Keyboard Shortcut to Pin Google Chrome Tab</h3>
<p>Earlier we had covered an extension called <a href="https://sumtips.com/software/browsers/edit-default-chrome-keyboard-shortcuts/" rel="noopener" target="_blank">Shortkeys (Custom Keyboard Shortcuts)</a> that allows users to add or customize default Chrome shortcuts. With Shortkeys you can add, disable, or change shortcut keys for most of the actions in Chrome. However, if you are looking for something simple that works straight out of the box, you can also have a look at Tab Pinner (Keyboard Shortcuts).</p>
<p>To start using Tab Pinner, just head over to Chrome Web Store and install the extension by clicking on the &#8220;Add to Chrome&#8221; button. Once installed, you just have to press Ctrl+Shift+X on your keyboard to pin any website. Here&#8217;s a small video demonstrating the feature:</p>
<div class="youtubevideo" style="position: relative; padding-bottom: 56.25%; padding-top: 25px; height: 0;"><iframe loading="lazy" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" src="https://www.youtube-nocookie.com/embed/buOBkxwhX90?rel=0&amp;showinfo=0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<p><strong>Install:</strong> <a href="https://chrome.google.com/webstore/detail/tab-pinner-keyboard-short/mbcjcnomlakhkechnbhmfjhnnllpbmlh" target="_blank" rel="noopener">Tab Pinner (Keyboard Shortcuts)</a></p>
<h3>Keyboard Shortcut to Pin Firefox Tab</h3>
<p>In Firefox, we can make use of an aptly named add-on &#8220;Toggle Pin Tab&#8221; to pin/unpin the current website. To install it, go to the extension&#8217;s page on Firefox Add-ons repository and click on &#8220;Add to Firefox&#8221; button.<br />
<img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://i0.wp.com/1.bp.blogspot.com/-mvi4Ps4QsE0/W5qUv0sou7I/AAAAAAAChjw/6EdfdnsaIZEQXF5p2hqt4ANUjP5EFJW7gCLcBGAs/s1600/toggle-pin-tab.png?resize=980%2C473&#038;ssl=1" alt="Toggle Pin Tab Firefox add-on" width="980" height="473" data-recalc-dims="1" /><br />
Once installed, you can any toggle the pin status of the current tab by simply pressing Alt+P on the keyboard.</p>
<p><strong>Install:</strong> <a href="https://addons.mozilla.org/en-US/firefox/addon/toggle-pin-tab/" target="_blank" rel="noopener">Toggle Pin Tab</a></p>
<h3>Keyboard Shortcut to Pin Opera Tab</h3>
<p>Even though Opera has built-in support for several advanced settings, it doesn&#8217;t offer one to toggle pin/unpin of a tab. Once again, we have a highly useful extension named &#8220;Shortkeys&#8221; to fix this.<br />
<img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://i0.wp.com/1.bp.blogspot.com/-UQEojDrqLrM/W5qUxO7sVjI/AAAAAAAChj0/IJBAULVz4eMXwHHizJsOTIp-F2HExdbZQCLcBGAs/s1600/shortkeys-opera.png?resize=980%2C551&#038;ssl=1" alt="Shortkeys for Opera" width="980" height="551" data-recalc-dims="1" /><br />
To install Shortkeys, go to the Opera add-ons page for the extension and click on &#8220;Add to Opera&#8221; button.</p>
<p>Shortkeys requires a little amount of work before you can start using it. After installing, go to the extension&#8217;s options page to select a key binding, action, and site&#8217;s on which you&#8217;d like the hotkey to work.</p>
<p>For our use case, you could use something like Ctrl+Shift+X for key binding, &#8220;Pin/unpin tab&#8221; for action, and &#8220;All sites&#8221; for active on. Finally, click on &#8220;Save&#8221; button. To see if it works, simply open a new tab or refresh one of the tabs you already open, and press the newly assigned keyboard shortcut.</p>
<p>Shortkeys comes with an option to import and export settings. This could be useful if you have a lot of customized keyboard combinations.</p>
<p><strong>Install:</strong> <a href="https://addons.opera.com/en/extensions/details/shortkeys/" target="_blank" rel="noopener">Shortkeys</a></p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/how-to/assign-keyboard-shortcut-pin-unpin-tab/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/how-to/assign-keyboard-shortcut-pin-unpin-tab/ - Assign Keyboard Shortcut to Pin Tab in Browsers"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/how-to/assign-keyboard-shortcut-pin-unpin-tab/&t=Assign Keyboard Shortcut to Pin Tab in Browsers"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/software/browsers/edit-default-chrome-keyboard-shortcuts/" rel="bookmark" title="Edit Default Google Chrome Keyboard Shortcuts, or Create Custom Ones">Edit Default Google Chrome Keyboard Shortcuts, or Create Custom Ones</a></li>
<li><a href="https://sumtips.com/software/browsers/how-to-close-duplicate-tabs-in-chrome-and-firefox/" rel="bookmark" title="How to Close Duplicate Tabs in Chrome and Firefox">How to Close Duplicate Tabs in Chrome and Firefox</a></li>
<li><a href="https://sumtips.com/how-to/enable-do-not-track-on-all-popular-browsers/" rel="bookmark" title="Activate Do Not Track on All Browsers">Activate Do Not Track on All Browsers</a></li>
<li><a href="https://sumtips.com/software/browsers/backup-and-restore-all-browsers-in-3/" rel="bookmark" title="Backup and Restore All Browsers in 3 Steps">Backup and Restore All Browsers in 3 Steps</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/abort-windows-shutdown-with-create/" rel="bookmark" title="Abort Windows Shutdown with a Keyboard Shortcut">Abort Windows Shutdown with a Keyboard Shortcut</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerShell Beautifier: Free Tool to Pretty Print .PS1 Script Files</title>
		<link>https://sumtips.com/software/powershell-beautifier-free-tool-to-pretty-print-ps1-script-files/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Sat, 16 Jun 2018 05:29:11 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Utilities]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=8938</guid>

					<description><![CDATA[PowerShell Beautifier is a free module that formats code, making it easier to read and validate. It can also replace aliases &#038; parameters with proper names<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/delete-files-older-than-x-days-in-windows-powershell-command-prompt/" rel="bookmark" title="Delete Files Older Than X Days in Windows with PowerShell &#038; CMD">Delete Files Older Than X Days in Windows with PowerShell &#038; CMD</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/find-files-larger-than-a-specific-size-with-powershell-command-prompt/" rel="bookmark" title="Find Files Larger than a Specific Size with PowerShell &#038; CMD">Find Files Larger than a Specific Size with PowerShell &#038; CMD</a></li>
<li><a href="https://sumtips.com/snippets/powershell/delete-all-files-while-maintaining-directory-structure/" rel="bookmark" title="PowerShell: Recursively Delete All Files While Maintaining Directory Structure">PowerShell: Recursively Delete All Files While Maintaining Directory Structure</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>Writing code can get messy, especially if you are using custom aliases or when you are cutting and pasting bits here and there. PowerShell Beautifier is a free command-line utility that formats, as you guessed it, PowerShell code, making it easier to read and validate them. It can also replace aliases and parameters with proper case and names to make your PowerShell code &#8216;commit-worthy.&#8217;</p>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-SokhtlXsRPI/WyPRsGg16TI/AAAAAAACgFk/-wm4MZhOvwwhEy5k9PbsRXyxH6Pzs2TUgCLcBGAs/s1600/PowerShell-Beautifier-Code.png?resize=738%2C268&#038;ssl=1" width="738" height="268" alt="PowerShell Beautifier Code" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<h2>Download and Install PowerShell Beautifier</h2>
<p>PowerShell Beautifier is available in PowerShell Gallery. To install it, open PowerShell as an Administrator and type in below code:</p>
<pre class="prettyprint">Install-Module -Name PowerShell-Beautifier</pre>
<p>Within a few seconds it would be downloaded and installed on your PC. To verify if the installation completed correctly, type in: Get-Help Edit-DTWBeautifyScript. You should be able to see a screen as below:<br />
<img loading="lazy" decoding="async" src="https://i0.wp.com/4.bp.blogspot.com/-JId8vGUE3vI/WyPK4BfwfdI/AAAAAAACgFY/s5n2XmSnpJUulDfe3RrUMYN7erczG64wACLcBGAs/s1600/PowerShell-Beautifier.png?resize=1140%2C662&#038;ssl=1" width="1140" height="662" alt="PowerShell Beautifier" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<h2>How to Use PowerShell Beautifier</h2>
<p>PowerShell Beautifier supports several parameters:</p>
<ul>
<li><code>-SourcePath</code>: Source file path</li>
<li><code>-DestinationPath</code>: Path to save file</li>
<li><code>-IndentType</code>: Tabs or spaces. Default is two spaces indent</li>
<li><code>-StandardOutput</code> or <code>-StdOut</code>: Get beautified code via stdout</li>
<li><code>-NewLine</code>: CRLF or LF style for newlines.</li>
</ul>
<p class="note">Before we start with the examples, please create a back up of your script files. Beautifier is programmed to rewrite to the final destination only if everything worked correctly; however, it’s always better to have a backup.</p>
<h3>Beautify Single File</h3>
<p>To use Beautifier, you just need to provide path to a script file. Be default, the source file is overwritten with two indent spaces:</p>
<pre class="prettyprint">Edit-DTWBeautifyScript C:\MyScripts\MyFile.ps1</pre>
<p>We will see how to keep the source file intact and change indentation in the examples that follow.</p>
<h3>Beautify Multiple PS Scripts in a Directory</h3>
<p>We can run the utility on multiple scripts in a folder by filtering them based on the extension:</p>
<pre class="prettyprint">Get-ChildItem -Path C:\MyScripts -Include *.ps1,*.psm1 | Edit-DTWBeautifyScript</pre>
<p>By using -Recurse parameter, this can be extended to subdirectories as well.</p>
<h3>Use Tabs indentation</h3>
<p>Don&#8217;t use spaces? Change indentation to Tabs with -IndentType parameter:</p>
<pre class="prettyprint">Edit-DTWBeautifyScript C:\MyScripts\MyFile.ps1 -IndentType Tabs</pre>
<h3>Save Formatted Code as New File</h3>
<p>To keep the source file intact and save the clean version to a new file, specify <code>-DestinationPath</code> with the new file name:</p>
<pre class="prettyprint">Edit-DTWBeautifyScript -SourcePath C:\MyScripts\MyFile.ps1 -DestinationPath C:\MyScripts\MyCleanFile.ps1</pre>
<h3>Change New Line Style</h3>
<p>By default, the beautifier uses the host OS’s style for newlines. To override this, use <code>-NewLine</code>:</p>
<pre class="prettyprint">Edit-DTWBeautifyScript C:\MyScripts\MyFile.ps1 -NewLine LF</pre>
<p>Overall, Beautifier is a useful tool to run your code through before sharing or publishing online. It would make code easier to read and also standardize the format. Hit <a href="https://www.powershellgallery.com/packages/PowerShell-Beautifier/" rel="nofollow" target="_blank">this link</a> to get the latest version from PowerShell Gallery.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/software/powershell-beautifier-free-tool-to-pretty-print-ps1-script-files/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/software/powershell-beautifier-free-tool-to-pretty-print-ps1-script-files/ - PowerShell Beautifier: Free Tool to Pretty Print .PS1 Script Files"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/software/powershell-beautifier-free-tool-to-pretty-print-ps1-script-files/&t=PowerShell Beautifier: Free Tool to Pretty Print .PS1 Script Files"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/" rel="bookmark" title="PowerShell: Copy All Files from Subfolders and Rename Duplicate">PowerShell: Copy All Files from Subfolders and Rename Duplicate</a></li>
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/delete-files-older-than-x-days-in-windows-powershell-command-prompt/" rel="bookmark" title="Delete Files Older Than X Days in Windows with PowerShell &#038; CMD">Delete Files Older Than X Days in Windows with PowerShell &#038; CMD</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/find-files-larger-than-a-specific-size-with-powershell-command-prompt/" rel="bookmark" title="Find Files Larger than a Specific Size with PowerShell &#038; CMD">Find Files Larger than a Specific Size with PowerShell &#038; CMD</a></li>
<li><a href="https://sumtips.com/snippets/powershell/delete-all-files-while-maintaining-directory-structure/" rel="bookmark" title="PowerShell: Recursively Delete All Files While Maintaining Directory Structure">PowerShell: Recursively Delete All Files While Maintaining Directory Structure</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerShell: Copy All Files from Subfolders and Rename Duplicate</title>
		<link>https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Fri, 15 Jun 2018 05:58:11 +0000</pubDate>
				<category><![CDATA[PowerShell Snippets]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=8945</guid>

					<description><![CDATA[This PowerShell script runs a search through subfolders and copies all files to target directory, keeping the original files intact by renaming duplicates<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/batch-rename-file-extensions-command-prompt-powershell/" rel="bookmark" title="Batch Rename File Extensions with Command Prompt / PowerShell">Batch Rename File Extensions with Command Prompt / PowerShell</a></li>
<li><a href="https://sumtips.com/software/windows-how-to-copy-folder-structure-without-copying-files/" rel="bookmark" title="Windows: How to Copy Folder Structure without Copying Files">Windows: How to Copy Folder Structure without Copying Files</a></li>
<li><a href="https://sumtips.com/snippets/powershell/delete-all-files-while-maintaining-directory-structure/" rel="bookmark" title="PowerShell: Recursively Delete All Files While Maintaining Directory Structure">PowerShell: Recursively Delete All Files While Maintaining Directory Structure</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/move-rename-wordpress-wp-content/" rel="bookmark" title="Move, Rename WordPress wp-content, Plugins &#038; Uploads Directory">Move, Rename WordPress wp-content, Plugins &#038; Uploads Directory</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://i0.wp.com/sumtips.com/wp-content/uploads/2018/07/powershell.png?resize=150%2C150" alt="" width="150" height="150" class="alignright size-full wp-image-8946" data-recalc-dims="1" />When copying and merging files from multiple folders, there may be times when you encounter conflicting files. These files may be having same file name but different content. To avoid replacing existing files they just have to be renamed. To help you out with this, here’s a PowerShell script to copy all files and automatically rename duplicate ones. All you need to do is provide the source and destination folder in the script, and you’re good to go. Let’s now look at the script.</p>
<h2>Copy Files and Rename Duplicate</h2>
<p>This PowerShell code runs a search through each subfolder within the source directory and copies all files to the target directory. While doing so, if any file already exist in the destination directory, it would rename the duplicate file by appending a number – which is automatically incremented – before the extension.</p>
<pre class="prettyprint">function fcopy ($SourceDir,$DestinationDir)
{
&#x9;Get-ChildItem $SourceDir -Recurse | Where-Object { $_.PSIsContainer -eq $false } | ForEach-Object ($_) {
&#x9;&#x9;$SourceFile = $_.FullName
&#x9;&#x9;$DestinationFile = $DestinationDir + $_
&#x9;&#x9;if (Test-Path $DestinationFile) {
&#x9;&#x9;&#x9;$i = 0
&#x9;&#x9;&#x9;while (Test-Path $DestinationFile) {
&#x9;&#x9;&#x9;&#x9;$i += 1
&#x9;&#x9;&#x9;&#x9;$DestinationFile = $DestinationDir + $_.basename + $i + $_.extension
&#x9;&#x9;&#x9;}
&#x9;&#x9;} else {
&#x9;&#x9;&#x9;Copy-Item -Path $SourceFile -Destination $DestinationFile -Verbose -Force
&#x9;&#x9;}
&#x9;&#x9;Copy-Item -Path $SourceFile -Destination $DestinationFile -Verbose -Force
&#x9;}
}
fcopy -SourceDir &#x22;C:\Source\Directory\&#x22; -DestinationDir &#x22;C:\Destination\Directory\&#x22;</pre>
<h3>Script Breakdown</h3>
<p>We start off by specifying the source and destination directory in this line:</p>
<pre class="prettyprint">fcopy -SourceDir "C:\Source\Directory\" -DestinationDir "C:\Destination\Directory\"</pre>
<p>Next, on running the script, a list of files is created by recursively searching through the source directory. Folders are excluded here.</p>
<pre class="prettyprint">Get-ChildItem $SourceDir -Recurse | Where-Object { $_.PSIsContainer -eq $false } | ForEach-Object ($_)</pre>
<p>Once we have a list of file names, we are using the Test-Path cmdlet to determine whether a file already exists in the destination.</p>
<pre class="prettyprint">if (Test-Path $DestinationFile)</pre>
<p>If it doesn’t exist, the file is immediately copied to the target directory.</p>
<pre class="prettyprint">Copy-Item -Path $SourceFile -Destination $DestinationFile -Verbose -Force</pre>
<p>Now, if a file does exist, script enters in a While loop.</p>
<pre class="prettyprint">while (Test-Path $DestinationFile) {
	$i += 1
	$DestinationFile = $DestinationDir + $_.basename + $i + $_.extension
}</pre>
<p>In this loop, file name is altered by adding a number at the end, but before the extension. This loop keeps on running until the script finds a name that doesn’t match an existing file. For instance, if a file New.pdf already exists, it will rename the next file as New2.pdf and copy it. Subsequent files are named New3.pdf, New4.pdf, and so on.</p>
<p>We are using Test-Path here as the default behavior for Copy-Item is to overwrite files in the target folder. With Test-Path, we are preserving all existing files and copying over new files.</p>
<h2>Move Files and Rename Duplicate</h2>
<p>Instead of copy, if you are looking to move all files to a single folder, simply replace <code>Copy-Item</code> with <code>Move-Item</code> cmdlet in the script. That’d move all files and automatically rename duplicate.</p>
<h2>Move Specific Files and Rename Duplicate</h2>
<p>Using <code>-Filter</code>, we can filter specific files:</p>
<pre class="prettyprint">-Filter *.txt</pre>
<p><code>-Filter</code> accepts a single string. To add more than one filter, you can use -Include:</p>
<pre class="prettyprint">-Include *.txt, *.xls</pre>
<p>This script is based on <a href="https://www.pdq.com/blog/copy-individual-files-and-rename-duplicates/" rel="nofollow" target="_blank">this post</a> by Kris Powell where he shows how to copy individual files and rename duplicates.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/ - PowerShell: Copy All Files from Subfolders and Rename Duplicate"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/snippets/powershell/copy-files-rename-duplicates-subfolder/&t=PowerShell: Copy All Files from Subfolders and Rename Duplicate"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/powershell/copy-move-files-folders-selectively-powershell/" rel="bookmark" title="How to Copy or Move Files Selectively with PowerShell">How to Copy or Move Files Selectively with PowerShell</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/batch-rename-file-extensions-command-prompt-powershell/" rel="bookmark" title="Batch Rename File Extensions with Command Prompt / PowerShell">Batch Rename File Extensions with Command Prompt / PowerShell</a></li>
<li><a href="https://sumtips.com/software/windows-how-to-copy-folder-structure-without-copying-files/" rel="bookmark" title="Windows: How to Copy Folder Structure without Copying Files">Windows: How to Copy Folder Structure without Copying Files</a></li>
<li><a href="https://sumtips.com/snippets/powershell/delete-all-files-while-maintaining-directory-structure/" rel="bookmark" title="PowerShell: Recursively Delete All Files While Maintaining Directory Structure">PowerShell: Recursively Delete All Files While Maintaining Directory Structure</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/move-rename-wordpress-wp-content/" rel="bookmark" title="Move, Rename WordPress wp-content, Plugins &#038; Uploads Directory">Move, Rename WordPress wp-content, Plugins &#038; Uploads Directory</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PowerShell: Automatically Cycle Through Tabs in Any Browser</title>
		<link>https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Thu, 14 Jun 2018 06:29:37 +0000</pubDate>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[PowerShell Snippets]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=8952</guid>

					<description><![CDATA[Here's a handy PowerShell script that automatically rotates browser tabs at desired time intervals. The script is browser independent so it would work with Google Chrome, Opera, Firefox, Edge, or any other browser your might be using.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/software/browsers/close-all-duplicate-opera-tabs-with/" rel="bookmark" title="Close All Duplicate Opera Tabs With a Single Click">Close All Duplicate Opera Tabs With a Single Click</a></li>
<li><a href="https://sumtips.com/software/browsers/how-to-close-duplicate-tabs-in-chrome-and-firefox/" rel="bookmark" title="How to Close Duplicate Tabs in Chrome and Firefox">How to Close Duplicate Tabs in Chrome and Firefox</a></li>
<li><a href="https://sumtips.com/software/browsers/tab-expose-thumbnail-preview-tabs/" rel="bookmark" title="Tab Expose: View Thumbnail Preview of all Open Chrome Tabs">Tab Expose: View Thumbnail Preview of all Open Chrome Tabs</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/restore-opened-folderstabs/" rel="bookmark" title="Restore Opened Folders/Tabs Automatically on Restart of Windows/Firefox">Restore Opened Folders/Tabs Automatically on Restart of Windows/Firefox</a></li>
<li><a href="https://sumtips.com/software/browsers/turn-off-css-on-a-specific-website-in-browser-for-testing/" rel="bookmark" title="Turn Off CSS on a Specific Website in Browser">Turn Off CSS on a Specific Website in Browser</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://i0.wp.com/sumtips.com/wp-content/uploads/2018/07/powershell.png?resize=150%2C150" alt="" width="150" height="150" class="alignright size-full wp-image-8946" data-recalc-dims="1" />There are extensions available that automatically rotates through open browser tabs. This could be convenient, say, if you wish to monitor various reports, news, sport scores, or stock updates that are open in multiple browser tabs. You can easily navigate through those tabs and view information without manual interaction.</p>
<h2>Automatically Cycle Through Tabs in Any Browser</h2>
<p>The problem with dedicated extensions is they are browser dependent. If you are looking for a universal solution that works with all browsers, here’s a useful PowerShell snippet.</p>
<pre class="prettyprint">while(1 -eq 1){
&#x9;$wshell=New-Object -ComObject wscript.shell;
&#x9;$wshell.AppActivate(&#x27;Opera&#x27;); # Activate on Opera browser
&#x9;Sleep 5; # Interval (in seconds) between switch 
&#x9;$wshell.SendKeys(&#x27;^{PGUP}&#x27;); # Ctrl + Page Up keyboard shortcut to switch tab
&#x9;$wshell.SendKeys(&#x27;{F5}&#x27;); # F5 to refresh active page
}</pre>
<p>When you run this script, PowerShell would switch focus to Opera browser and cycle through all open tabs with five second intervals. It would also reload the content of the active page each time.</p>
<p>Here, we have “Opera” in the code. You can as easily automatically cycle through tabs in Google Chrome, Mozilla Firefox, Microsoft Edge, or Internet Explorer. All you need to do is change <code>$wshell.AppActivate(&#x27;Opera&#x27;);</code> with the browser you are using.</p>
<p>In the same way, you can alter the interval from 5 seconds to another one, for instance 30 seconds, based on the requirement by editing Sleep 5; value. Additionally, you have the option to disable the automatic reloading of pages when tabs get activated by simply commenting or removing the line <code>$wshell.SendKeys(&#x27;{F5}&#x27;);</code>.</p>
<p>By default, PowerShell switches to the last open browser window on executing the script. This can be changed to the window of interest by manually opening it.</p>
<p>The script is designed with multiple tabs in mind, but it can as well be used on a website that does not reload its content regularly. You can remove or comment out <code>$wshell.SendKeys(&#x27;^{PGUP}&#x27;);</code> to auto reload pages after a specific time interval.</p>
<p>That’s all.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/ - PowerShell: Automatically Cycle Through Tabs in Any Browser"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/snippets/powershell/automatically-cycle-through-tabs-in-any-browser/&t=PowerShell: Automatically Cycle Through Tabs in Any Browser"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/software/browsers/close-all-duplicate-opera-tabs-with/" rel="bookmark" title="Close All Duplicate Opera Tabs With a Single Click">Close All Duplicate Opera Tabs With a Single Click</a></li>
<li><a href="https://sumtips.com/software/browsers/how-to-close-duplicate-tabs-in-chrome-and-firefox/" rel="bookmark" title="How to Close Duplicate Tabs in Chrome and Firefox">How to Close Duplicate Tabs in Chrome and Firefox</a></li>
<li><a href="https://sumtips.com/software/browsers/tab-expose-thumbnail-preview-tabs/" rel="bookmark" title="Tab Expose: View Thumbnail Preview of all Open Chrome Tabs">Tab Expose: View Thumbnail Preview of all Open Chrome Tabs</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/restore-opened-folderstabs/" rel="bookmark" title="Restore Opened Folders/Tabs Automatically on Restart of Windows/Firefox">Restore Opened Folders/Tabs Automatically on Restart of Windows/Firefox</a></li>
<li><a href="https://sumtips.com/software/browsers/turn-off-css-on-a-specific-website-in-browser-for-testing/" rel="bookmark" title="Turn Off CSS on a Specific Website in Browser">Turn Off CSS on a Specific Website in Browser</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Open File at a Specific Line Number in Notepad++</title>
		<link>https://sumtips.com/how-to/open-file-at-a-specific-line-number-in-notepad/</link>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Wed, 13 Jun 2018 06:14:01 +0000</pubDate>
				<category><![CDATA[How To?]]></category>
		<category><![CDATA[Command Prompt]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Notepad]]></category>
		<category><![CDATA[Shortcut]]></category>
		<guid isPermaLink="false">http://sumtips.com/?p=8949</guid>

					<description><![CDATA[Here's how you can directly open a file at a specific line number in Notepad++ when launched from the command line or via a shortcut on your computer.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/how-to/create-mozilla-firefox-desktop-shortcuts-to-specific-profiles/" rel="bookmark" title="Create Mozilla Firefox Desktop Shortcuts to Specific Profiles">Create Mozilla Firefox Desktop Shortcuts to Specific Profiles</a></li>
<li><a href="https://sumtips.com/how-to/batch-file-to-open-multiple-programs-at/" rel="bookmark" title="Batch File To Open Multiple Programs At Once">Batch File To Open Multiple Programs At Once</a></li>
<li><a href="https://sumtips.com/how-to/automatically-start-and-close-programs-at-specific-time/" rel="bookmark" title="Automatically Start and Close Programs at Specific Time">Automatically Start and Close Programs at Specific Time</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/create-shortcuts-from-command-line-in-windows/" rel="bookmark" title="Create File or Folder Shortcuts from Command Line in Windows">Create File or Folder Shortcuts from Command Line in Windows</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/recursively-delete-specific-file-type-from-folder-subfolders/" rel="bookmark" title="Recursively Delete a Specific File Type from all Subfolders">Recursively Delete a Specific File Type from all Subfolders</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p>Notepad++ has a built-in feature where it remembers the last edited position in a document. This could be quite useful when one is working on a large file regularly. Each time you open Notepad++, you are directly brought to the line where you left off previously. For this functionality to work, you’ve to keep the document open in the editor. Depending on the file or environment, it may not be always possible to do that. An alternate way to open file at a specific line number in Notepad++ is to make use of a command line switch while opening the file. Here’s how to do it.</p>
<h2>Open File at a Specific Line Number in Notepad++</h2>
<p>We can control Notepad++ startup by passing the line number as an argument at launch time from the command line or via a shortcut. You can use the command-line option as following:</p>
<pre class="prettyprint">-n&#x3C;line number&#x3E;</pre>
<p>For example, to open a file directly at line 1500, we can pass it as <code>notepad++ filename -n1500</code>.</p>
<p>To run this from command prompt, you can use this command:</p>
<pre class="prettyprint">start notepad++ &#x22;C:\Files\file.txt&#x22; -n1500</pre>
<h3>Open Multiple File at a Specific Line Number</h3>
<p>In the same way, you can open multiple files at a specific line number like this:</p>
<pre class="prettyprint">start notepad++ -multiInst &#x22;C:\Files\file1.txt&#x22; -n1500
start notepad++ -multiInst &#x22;C:\Files\file2.txt&#x22; -n1000</pre>
<p>By default Notepad++ runs in a single instance. -multiInst enables opening of multiple instances.</p>
<h3>Create Desktop Shortcut to Open File at Specific Line</h3>
<p>We can also create a desktop shortcut to the file by editing the target path as below. The target field should read something like:</p>
<pre class="prettyprint">&#x22;C:\Program Files (x86)\Notepad++\notepad++.exe&#x22; &#x22;C:\Files\file.txt&#x22; -n1500</pre>
<p><img loading="lazy" decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-wKm_lAdFfPI/WyExhto-0sI/AAAAAAACgEI/dFhBvbU5DHYc0DgRxmMH94cVfV_4ldJ6ACLcBGAs/s1600/notepad-file.png?resize=363%2C399&#038;ssl=1" width="363" height="399" alt="Open Text File at a Specific Line Number in Notepad++" class="aligncenter size-medium" data-recalc-dims="1" /></p>
<h3>Open Text File at a Specific Line Number with AutoHotkey</h3>
<p>If you use AutoHotkey, we can create a shortcut to launch file at a specific line:</p>
<pre class="prettyprint">^!1::
Run, &#x22;C:\Program Files (x86)\Notepad++\notepad++.exe&#x22; &#x22;C:\Files\file.txt&#x22; -n99
Return</pre>
<p>Similarly, we can set up hotkeys for multiple files and line numbers.</p>
<p>Notepad++ supports a lot of command line switches. These can be used to manipulate how a file opens:</p>
<ul>
<li><code>-alwaysOnTop</code>: Opens file as topmost window</li>
<li><code>-c&#x3C;column number&#x3E;</code>: Scroll to particular <code>&#x3C;column number&#x3E;</code> in file</li>
<li><code>-l&#x3C;language&#x3E;</code>: Applies specified <code>&#x3C;language&#x3E;</code> syntax highlighting</li>
<li><code>-multiInst</code>: Launch multiple instances of Notepad++</li>
<li><code>-n&#x3C;line number&#x3E;</code>: Go to particular <code>&#x3C;line number&#x3E;</code> after opening</li>
<li><code>-noPlugins</code>: Disable all plugins for the specified file</li>
<li><code>-nosession</code>: Launch file in a blank session</li>
<li><code>-notabbar</code>: Disable tab interface</li>
<li><code>-x&#x3C;x-coordinate&#x3E;</code>: Position text file at a specific horizontal position on screen</li>
<li><code>-y&#x3C;y-coordinate&#x3E;</code>: Position file at a specific vertical position on screen</li>
</ul>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/how-to/open-file-at-a-specific-line-number-in-notepad/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/how-to/open-file-at-a-specific-line-number-in-notepad/ - How to Open File at a Specific Line Number in Notepad++"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/how-to/open-file-at-a-specific-line-number-in-notepad/&t=How to Open File at a Specific Line Number in Notepad++"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/how-to/create-mozilla-firefox-desktop-shortcuts-to-specific-profiles/" rel="bookmark" title="Create Mozilla Firefox Desktop Shortcuts to Specific Profiles">Create Mozilla Firefox Desktop Shortcuts to Specific Profiles</a></li>
<li><a href="https://sumtips.com/how-to/batch-file-to-open-multiple-programs-at/" rel="bookmark" title="Batch File To Open Multiple Programs At Once">Batch File To Open Multiple Programs At Once</a></li>
<li><a href="https://sumtips.com/how-to/automatically-start-and-close-programs-at-specific-time/" rel="bookmark" title="Automatically Start and Close Programs at Specific Time">Automatically Start and Close Programs at Specific Time</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/create-shortcuts-from-command-line-in-windows/" rel="bookmark" title="Create File or Folder Shortcuts from Command Line in Windows">Create File or Folder Shortcuts from Command Line in Windows</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/recursively-delete-specific-file-type-from-folder-subfolders/" rel="bookmark" title="Recursively Delete a Specific File Type from all Subfolders">Recursively Delete a Specific File Type from all Subfolders</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Control YouTube Playback in Chrome with AutoHotkey</title>
		<link>https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/</link>
					<comments>https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/#comments</comments>
		
		<dc:creator><![CDATA[Renji]]></dc:creator>
		<pubDate>Tue, 12 Jun 2018 11:01:00 +0000</pubDate>
				<category><![CDATA[AutoHotkey Snippets]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[YouTube]]></category>
		<guid isPermaLink="false">http://leoworld.wordpress.com/2009/04/26/funny-google-image-search-with-javascript-2</guid>

					<description><![CDATA[Here we have a quick script that would allow you to control YouTube playback in Chrome with AutoHotkey while working in another tab, window, or application.<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/autohotkey/create-youtube-playlist-by-copying-video-links-to-clipboard/" rel="bookmark" title="AutoHotkey: Create YouTube Playlist by Copying Video Links to Clipboard">AutoHotkey: Create YouTube Playlist by Copying Video Links to Clipboard</a></li>
<li><a href="https://sumtips.com/how-to/shutdown-or-hibernate-computer-after-playback-finishes/" rel="bookmark" title="Shutdown or Hibernate Computer After Playback Finishes">Shutdown or Hibernate Computer After Playback Finishes</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/resize-a-program-window-with-custom-dimensions-autohotkey/" rel="bookmark" title="Resize a Program Window to Custom Dimensions using AutoHotkey">Resize a Program Window to Custom Dimensions using AutoHotkey</a></li>
<li><a href="https://sumtips.com/software/browsers/resume-youtube-videos-from-last-played-position-chrome-firefox/" rel="bookmark" title="Resume YouTube Videos from Last Played Position in Chrome &#038; Firefox">Resume YouTube Videos from Last Played Position in Chrome &#038; Firefox</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/list-of-youtube-feed-urls/" rel="bookmark" title="List of YouTube Feed URLs">List of YouTube Feed URLs</a></li>
</ul>
</div>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://i0.wp.com/sumtips.com/wp-content/uploads/2009/04/AutoHotkey-300x225.png?resize=300%2C225" alt="Control YouTube Playback in Chrome with AutoHotkey" width="300" height="225" class="alignright size-medium wp-image-8926" srcset="https://i0.wp.com/sumtips.com/wp-content/uploads/2009/04/AutoHotkey.png?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/sumtips.com/wp-content/uploads/2009/04/AutoHotkey.png?w=320&amp;ssl=1 320w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1" />In our last post, we saw a quick way to <a href="http://sumtips.com/tips-n-tricks/create-youtube-playlist-by-copying-video-links-to-clipboard/" rel="noopener" target="_blank">create a YouTube playlist</a> by copying several video links to the clipboard with AutoHotkey. Now in this post, we have a script that would allow you to control YouTube playback in Chrome with AutoHotkey while you are working in another app. This would allow you to listen and control your favorite music playlist without having to switch to the YouTube tab each time you wish to play/pause or switch songs.</p>
<p>Control YouTube Playback in Chrome with AutoHotkey<br />
Drop below script into your AHK file and reload it.</p>
<pre class="prettyprint">#Persistent
#NoEnv
#SingleInstance, Force
DetectHiddenWindows, On
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 2
controlID &#x9;&#x9;:= 0
return

#IfWinNotActive, ahk_exe chrome.exe

; Play/pause
+!p::
&#x9;ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
&#x9;
&#x9;ControlFocus,,ahk_id %controlID%

&#x9;IfWinExist, YouTube
&#x9;{
&#x9;&#x9;ControlSend, Chrome_RenderWidgetHostHWND1, k , Google Chrome
&#x9;&#x9;return
&#x9;}
&#x9;Loop {
&#x9;&#x9;IfWinExist, YouTube
&#x9;&#x9;&#x9;break

&#x9;&#x9;ControlSend, , ^{PgUp} , Google Chrome
&#x9;&#x9;sleep 150
&#x9;}
&#x9;ControlSend, , k , Google Chrome
return

; Next video in playlist
+!n::
&#x9;ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
&#x9;
&#x9;ControlFocus,,ahk_id %controlID%

&#x9;IfWinExist, YouTube
&#x9;{
&#x9;&#x9;ControlSend, Chrome_RenderWidgetHostHWND1, +n , Google Chrome
&#x9;&#x9;return
&#x9;}
&#x9;Loop {
&#x9;&#x9;IfWinExist, YouTube
&#x9;&#x9;&#x9;break

&#x9;&#x9;ControlSend, , ^{PgUp} , Google Chrome
&#x9;&#x9;sleep 150
&#x9;}
&#x9;ControlSend, , +n , Google Chrome
return

; Previous video in playlist
+!b::
&#x9;ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
&#x9;
&#x9;ControlFocus,,ahk_id %controlID%

&#x9;IfWinExist, YouTube
&#x9;{
&#x9;&#x9;ControlSend, Chrome_RenderWidgetHostHWND1, +p , Google Chrome
&#x9;&#x9;return
&#x9;}
&#x9;Loop {
&#x9;&#x9;IfWinExist, YouTube
&#x9;&#x9;&#x9;break

&#x9;&#x9;ControlSend, , ^{PgUp} , Google Chrome
&#x9;&#x9;sleep 150
&#x9;}
&#x9;ControlSend, , +p , Google Chrome
return

; Seek back
+!left::
&#x9;ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
&#x9;
&#x9;ControlFocus,,ahk_id %controlID%

&#x9;IfWinExist, YouTube
&#x9;{
&#x9;&#x9;ControlSend, Chrome_RenderWidgetHostHWND1, j , Google Chrome
&#x9;&#x9;return
&#x9;}
&#x9;Loop {
&#x9;&#x9;IfWinExist, YouTube
&#x9;&#x9;&#x9;break

&#x9;&#x9;ControlSend, , ^{PgUp} , Google Chrome
&#x9;&#x9;sleep 150
&#x9;}
&#x9;ControlSend, , j , Google Chrome
return

; Seek forward
+!right::
&#x9;ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
&#x9;
&#x9;ControlFocus,,ahk_id %controlID%

&#x9;IfWinExist, YouTube
&#x9;{
&#x9;&#x9;ControlSend, Chrome_RenderWidgetHostHWND1, l , Google Chrome
&#x9;&#x9;return
&#x9;}
&#x9;Loop {
&#x9;&#x9;IfWinExist, YouTube
&#x9;&#x9;&#x9;break

&#x9;&#x9;ControlSend, , ^{PgUp} , Google Chrome
&#x9;&#x9;sleep 150
&#x9;}
&#x9;ControlSend, , +l , Google Chrome
return

#IfWinNotActive</pre>
<p>Five keyboard shortcuts are available here: play/pause, next video in playlist, and previous video in playlist, seek back, and seek forward. If you are playing a single video, the next video shortcut would simply start playing the next suggested video. I’ve commented each shortcut above. You can customize it as per your liking, and also remove a particular shortcut if you don’t plan on using it. To add a new shortcut, you can refer <a href="https://support.google.com/youtube/answer/7631406" rel="noopener" target="_blank">this page</a> for the list of shortcuts supported by YouTube.</p>
<p>There are a few points to make note of while using this script due to restrictions implemented in Chrome:<br />
1. If possible, have YouTube as the first tab. Not necessary, but I have seen this gives the fastest response.<br />
2. Have all the tabs in a single Chrome window.</p>
<br><a href="https://plusone.google.com/_/+1/confirm?url=https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-fugHnxjbc00/T4U8FOX8yrI/AAAAAAAAR24/k32Hkmfb1NM/s1600/st-gplus.png?w=1140" alt="Share this post on Google+" data-recalc-dims="1" /></a>&nbsp;<a href="http://twitter.com/home?status=https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/ - Control YouTube Playback in Chrome with AutoHotkey"><img decoding="async" src="https://i0.wp.com/3.bp.blogspot.com/-gkpeomZIZ-w/T4U8GQqheLI/AAAAAAAAR3A/SuPpT5thOss/s1600/st-twitter.png?w=1140" alt="Share this post on Twitter" data-recalc-dims="1" /></a>&nbsp;<a href="http://www.facebook.com/sharer.php?u=https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/&t=Control YouTube Playback in Chrome with AutoHotkey"><img decoding="async" src="https://i0.wp.com/2.bp.blogspot.com/-jAhAoxGWrHo/T4U7-rz22cI/AAAAAAAAR2w/q4s4tzEUSTM/s1600/st-facebook.png?w=1140" alt="Share this post on Facebook" data-recalc-dims="1" /></a>&nbsp;<hr>Connect with <a href="http://sumtips.com" title="Visit SumTips.com">SumTips</a> on <a href="http://www.facebook.com/SumTips" title="SumTips Facebook page">Facebook</a>, <a href="http://twitter.com/SumTips" title="SumTips Twitter profile">Twitter</a>, or <a href="http://feeds.sumtips.com/Sumtips" title="SumTips RSS Feed">Subscribe with RSS</a><div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related tips:</h3><ul class="pl">
<li><a href="https://sumtips.com/snippets/autohotkey/create-youtube-playlist-by-copying-video-links-to-clipboard/" rel="bookmark" title="AutoHotkey: Create YouTube Playlist by Copying Video Links to Clipboard">AutoHotkey: Create YouTube Playlist by Copying Video Links to Clipboard</a></li>
<li><a href="https://sumtips.com/how-to/shutdown-or-hibernate-computer-after-playback-finishes/" rel="bookmark" title="Shutdown or Hibernate Computer After Playback Finishes">Shutdown or Hibernate Computer After Playback Finishes</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/resize-a-program-window-with-custom-dimensions-autohotkey/" rel="bookmark" title="Resize a Program Window to Custom Dimensions using AutoHotkey">Resize a Program Window to Custom Dimensions using AutoHotkey</a></li>
<li><a href="https://sumtips.com/software/browsers/resume-youtube-videos-from-last-played-position-chrome-firefox/" rel="bookmark" title="Resume YouTube Videos from Last Played Position in Chrome &#038; Firefox">Resume YouTube Videos from Last Played Position in Chrome &#038; Firefox</a></li>
<li><a href="https://sumtips.com/tips-n-tricks/list-of-youtube-feed-urls/" rel="bookmark" title="List of YouTube Feed URLs">List of YouTube Feed URLs</a></li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://sumtips.com/snippets/autohotkey/control-youtube-playback-in-chrome-with-autohotkey/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
