Scripting Languages

27K

Solutions

21K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello experts,
I was wondering how to make an opposition of If WinActive:
I read documentation related to WinActive:
here
but they don't recommend IfWin[Not]Active
Deprecated: This command is not recommended for use in new scripts. Use the WinActive function instead.
Can I make an Else instead like this:
:*:ahk::
If (WinActive("ahk_exe sciTE.exe"))
;~ Do nothing
Else 
{
Send, AutoHotkey
}
Return

Open in new window

Thank you for your help.
0
PMI ACP® Project Management
LVL 13
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Hello experts,
I have the following AutoHotkey which allows me to send Alt + Y1 to directly select my Add-in tab on Excel .
I don't understand why it works one computer equipped by Win 10 Excel 2019 and it doesn't on my other computer equipped by Win 10 Excel 2016.
!y::
SetKeyDelay , 10 ; time to wait between send
WinGetActiveTitle, Title
IfInString, Title, Excel
{
	Send, !Y
 Send, 1
}
Return

Open in new window


Any recommendation or advice?
Thank you for your help.
0
Hello experts,
I have the following script which allows me to zip file with 7-zip:
;====================================
; 7zip
;====================================

#IfWinActive,ahk_class CabinetWClass
+F7::
Send, +{F10}
Sleep, 100
Send, 7
Return
#If

Open in new window

2019-09-13_16h25_09.pngMost of the time it works however sometimes,
Send, 7 

Open in new window

is not performed and I just get:
2019-09-13_16h26_40.pngIf you have recommendations on this, please let me know.
0
Hello experts,
I have the following AutoHotkey reported at: Question 29156945 which allows me to remove two consecutive blank  lines and cr lf characters:

;====================================
;Remove two consecutive blank lines
;====================================

^!Space::
  ; clipboard:="" ; Joe commented out - not needed because Ctrl+c replaces Clipboard
  Send, ^a ; Luis commented out because he prefers to select the block
  Send, ^c
  ClipWait,1 ; Joe added - good practice to do a ClipWait after Ctrl+c
  If (ErrorLevel=1)
  {
    MsgBox,4144,Error,No text appeared on clipboard after waiting for one second
    Return
  }
  clipboard:= RegExReplace(clipboard, "\R(?=\R{2,})") ;find 2 consecutive blank lines
  sleep 100
  ; Joe: see if last two chars are CR and/or LF
  LastChar:=SubStr(Clipboard,0,1)
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  Send, ^v
  Return

Open in new window


I was wondering if there is a way to take it as a reference to remove 2 or more blank consecutive lines?
Thank you for your help.
0
Hello experts,
I would like to automate the following daily process through AutoHotkey:
Every time when I made a copy paste with multiple lines like this:
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
I need to manually move up from line 9 to line 1 (initial line of the copy-paste).
The idea is to:
Perform the copy-paste:
Send keys to move up automatically to the first string of the clipboard pasted.
In my example I expect to move the cursor from 9, last string of the clipboard to the first string of the clipboard l of line 1.
Obviously the AutoHotkey should be able to move up no matter the number of lines involved by the copy-paste
I expect the AutoHotkey to work on Notepad++, Word, Outlook EE block description and Excel if possible (:-))
If you have questions, please contact me.
Thank you for your help.
0
hello,

i have a powershells cipt to create shared folder and apply ntfs right on the file server, but now i have error:

the script:

$csvFile = "D:\test.csv"

$create = Import-CSV $csvFile

function DoPermissions
{
    param( $permissionGroup, $folder, $level, [switch] $NoInheritance)
    $toAdd = $permissionGroup -split ";"
    $InheritFlags = if ($NoInheritance) { 'None' } else { 'ContainerInherit,ObjectInherit' }
    Write-Host $folder
    foreach ($item in $toAdd)
    {
        $acl = (Get-Item $folder).GetAccessControl('Access')
        $ar = New-Object System.Security.AccessControl.FileSystemAccessRule($item, $level, $InheritFlags,'None','Allow')
        $acl.SetAccessRule($ar)
        Set-ACL -path $folder -AclObject $acl
    }
}

foreach ($folder in $create)
{
    $fullPath = $folder.folder #$path + $folder.folder
    if (!(Test-Path $fullPath)) {
      New-Item -ItemType Directory -Path $fullPath
      $fAcl = Get-Acl -Path $fullPath
      $fAcl.SetAccessRuleProtection($true, $true)
      Set-Acl -Path $fullPath -AclObject $fAcl
    }

    if ($folder.full_control) {DoPermissions $folder.full_control $fullPath "FullControl"}
    if ($folder.modify) {DoPermissions $folder.modify $fullPath "Modify"}
    if ($folder.read_execute) {DoPermissions $folder.read_execute $fullPath "ExecuteFile"}
    if ($folder.list_folder_content) {DoPermissions $folder.list_folder_content $fullPath "read,ExecuteFile" -NoInheritance}
    if ($folder.read) {DoPermissions 

Open in new window

0
Hello experts,
I have the following AutoHotkey script reported at: https://www.experts-exchange.com/questions/29157223/Autohotkey-assign-EE-link-option.html
;====================================
;Send blocks comment
;====================================

:*:blc::
If ((WinActive("ahk_exe excel.exe")) or (WinActive("ahk_exe vbsedit.exe")))
  CommentBlock:="' *************************************************************************`n"
              . "' Author:`n"
              . "' Creation date:`n"
              . "' Description:`n"
              . "' ***************************************************************************`n"
Else
If (WinActive("ahk_exe notepad++.exe"))
  CommentBlock:="Rem ======================================================================`n"
              . "Rem Author:`n"
              . "Rem Creation date:`n"
              . "Rem Description:`n"
              . "Rem ======================================================================`n"
Else
If (WinActive("ahk_exe powershell_ise.exe"))
 CommentBlock:="# ===========================================================================`n"
              . "# Author:`n"
              . "# Creation date:`n"
              . "# Description:`n"
              . "# ===========================================================================`n"
Else
If (WinActive("ahk_exe sciTE.exe"))
 CommentBlock:="; 

Open in new window

0
Hello experts,
I have the following script reported at:
I would like to take as a reference to close all active process.
WinGet,AllWindows,List
Loop,%AllWindows%
{
  CurrentID:=AllWindows%A_Index%
  WinGetClass,CurrentClass,ahk_id %CurrentID%
  If (CurrentClass="CabinetWClass")
    WinClose,ahk_id %CurrentID%
}
Return

Open in new window

This AutoHotkey will be used in case of emergency.
Thank you for your help.
0
Hello experts,
I am looking for an AutoHotkey that allows me to close all windows explorer windows (active, and minimized one's).
If you have advice on this please let me know.
Thank you for your help.
0
Hello experts,
The following script reported:Here
allows me to comment and uncomment a selection.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
commentChars := "//"
!^c::
    send ^c
    delimiter := "`n"
    thisvar := ""
    size := parsedTextContainerSize(clipboard,delimiter)
    Loop, parse, clipboard, `n, `r
    {
        ;MsgBox, index = %A_Index% . size = %size%
        if (A_Index < size)
        {
            thisvar := thisvar . commentChars . A_LoopField . "`n"
        }
        else
        {
            ;MsgBox, finally = %A_Index%
            thisvar := thisvar . commentChars . A_LoopField
        }
    }

    clipboard := thisvar
    send ^v
return

!^x::
    send ^c
    delimiter := "`n"
    thisvar := ""
    size := parsedTextContainerSize(clipboard,delimiter)
    Loop, parse, clipboard, `n, `r
    {
        line := ""
        firtTwoChars := ""
        pos := -1
        StringGetPos, pos, A_LoopField, %commentChars%
        if (pos = 0) 
        {
            ;StringReplace, newString, originalString, –, %A_Space%, 1
            StringReplace, line, A_LoopField, %commentChars%, ,
            ;MsgBox, line = %line%
        }
        else
        {
            line := A_LoopField
        }

        ;MsgBox, index = %A_Index% . size = %size%
        if (A_Index < size)
        {
            thisvar := 

Open in new window

0
Rowby Goren Makes an Impact on Screen and Online
LVL 13
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Hello experts,
I am having some little issues with my quick access folder.
2019-09-11_14h32_14.pngEvery time that I open a document the file is pined to quick access folder. As a result, when I want to go quick access folder through Win + E, it takes a lot of time to access as they are a lot of files and folders pined.
I want to tackle this issue through two approaches:
1-Be able to swiftly remove file & folder from quick folder. I know that I can do this through: {F10} + {Down Arrow 5} + {Enter}
2019-09-11_14h32_36.pngProbably there is another smart way to do this. If so please let me know.
2-Restrict the quick access folder for specific files and folders and avoid when I open a file or a folder it goes directly to quick access folder
Thank you for your help.
Thank you for your help.
0
In this PowerShell code:

-------------------------------------------------------------------------------------------------------------------------------
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
    InitialDirectory = [Environment]::GetFolderPath('Desktop')
    Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
}
$null = $FileBrowser.ShowDialog()
-------------------------------------------------------------------------------------------------------------------------------

How can I add a msg like: "Please choose your userinfo file:"
0
Hello experts,
I was wondering how to set up an AutoHotkey to send comment block based on activewindows.
I need to send:
'-- ======================================================================
'-- Author:
'-- Creation date:
'-- Description:
'-- ======================================================================

Open in new window

If Ssms.exe process name is active.


Rem ======================================================================
Rem Author:
Rem Creation date:
Rem Description:
Rem ======================================================================

Open in new window

If Notepad++ process name is active.

'*************************************************************************
' Author:
' Creation date:
' Description:
'***************************************************************************

Open in new window


If excel.exe process or vbsedit.exe process name is active.

#===========================================================================
# Author:
# Creation date:
# Description:
#===========================================================================

Open in new window


If powershell_ise.exe is active.

I attached the various windows related to each process.
If you have questions, please contact me.
VBA.png
Ssms.png
VBS.png
Notepadplusplus.png
Powershell.png
0
There have been several places on the internet that say it is "WMIC ComputerSystem where caption='Brian' rename Bill" but that doesn't seem to work. Maybe the command is different in Windows 7 and Windows 10? Don't know but I am looking for a way to rename a computer (non-domain) from the command prompt.
0
Hi,

I need to compare date but I don't know how to convert date from hash table likeUsersDate = @{}

Example:

$UsersDate = @{}
....
Where-Object {( get-date($UsersDate[$_.UPN].Date)) -lt $Date}


How can I do that?
0
Hi,


How can I code this with PowerShell.

I have 2 csv files:

users.csv contains:

    Login,Name,City

UsersBirthDate.csv contains:

    Login,Age,BirthDate

The algorithm should look like this:

Fo each login in users.csv if city = Tokyo Then

   Search user login in UsersBirthDate.csv  if the Age is lower than 40  Then

       Take Name,City,Age,BirthDate and add the info in results.csv
0
Hello experts,
I am trying to run spotify with AutoHotkey.
spotify.exe is located at:
%userprofile%\AppData\Local\Microsoft\WindowsApps

Open in new window

I would like to declare Spotify as variable and run it through:

#!t::
If (FileExist(%Spotify%))
Run, %Spotify%
Else
 MsgBox,4112,Error, Spotify doesn't exists on your system.
Return
How should I declare:
Spotify:=""
My attempt:
Spotify:=%userprofile% . "\AppData\Local\Microsoft" . "\spotify.exe"

Open in new window

Thank you for your help.
0
By means of a script, I would like to produce a list, separated by commas.

I would like to input the first number:  1  (for example)
and then a second number: 10 (for example)
the second number will vary.

I need the output to look like this:

1,6,2,7,3,8,4,9,5,10

What simple script will allow me to have this variation?
0
I wud like to prevent non-admin users from amending the following
2 registry values:

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
a) ProxyEnable
b) ProxyServer

Seen the following link but still can't grasp it, so will need the
exact setacl command to be applied on the registry:
https://helgeklein.com/setacl/documentation/command-line-version-setacl-exe/

Another EE expert has given me the PS method below
but we don't have access to PS & would like to do it in
batch scripts/commands.

1:$acl = Get-Acl "HKLM:\SOFTWARE\Example"
2:$person = [System.Security.Principal.NTAccount]"BuiltIn\Users"          
3:$access = [System.Security.AccessControl.RegistryRights]"FullControl"
4:$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit"
5:$propagation = [System.Security.AccessControl.PropagationFlags]"None"
6:$type = [System.Security.AccessControl.AccessControlType]"Allow"
7:$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person,$access,$inheritance,$propagation,$type)
8:$acl.AddAccessRule($rule)
9:$acl |Set-Acl
0
Build an E-Commerce Site with Angular 5
LVL 13
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Hello experts,
I am looking for an AutoHotkey to easily open/edit document based on extension.
The idea is the following:
Send F10+Tab 3 if file has ahk extension and just send F10 +Tab 2 if file finishes with other extension.
Option 1 will allows me to open/edit file with my SciTE4AutoHotkey and option 2 to open/edit with Notepad++. If there is better way to do this, please let me know.
Option 1:
edit-ahk.pngOption2:
edit-notepad-plus-plus.pngThank you for your help.
0
Hello experts,
I frequently use gmail and google drive.
I was wondering how to set up some ahk which are not part of default shortcuts keyboard proposed.
1)      Be able to download a document on drive
The following combination works but I don't know if there is an smart way to do this: {Shift}+{F10 }+ {Arrow up 2}+{Enter}
2)      Be able to download an attached file from gmail:
The following combination works but I don't know if there is an smart way
3)      Be able to attach a file when composing a new e-mail
The following combination works but I don't know if there is an smart way to do this: {Tab 7}+{Enter}
4)      Be able to open received message in a new windows
Thank you for your help.
0
Hello experts,
I was wondering how to create an AutoHotkey to perform this daily action:
Copy path of word, excel, powerpoint document.
The idea is the following:
I am working on an office document. I launch the related AutoHotkey through shortcut set up to recover path to clipboard and then paste the clipboard if I want to attach it instead of closing the file and trying to find where is located the document.
Here is the option available in word:
It can be activated through Alt + F
Copy-path.pngI don't know how to select this copy path button through the keyboard.
If you have advice or an smart way to cover this daily action please let me know.
0
Hello experts,
I have the following AutoHotkey witch allows me to remove two consecutive blank lines.

^!Space::
  ; clipboard:="" ; Joe commented out - not needed because Ctrl+c replaces Clipboard
  ;~ Send, ^a ; Luis commented out because he prefers to select the block
  Send, ^c
  ClipWait,1 ; Joe added - good practice to do a ClipWait after Ctrl+c
  If (ErrorLevel=1)
  {
    MsgBox,4144,Error,No text appeared on clipboard after waiting for one second
    Return
  }
  clipboard:= RegExReplace(clipboard, "\R(?=\R{2,})") ;find 2 consecutive blank lines
  sleep 100
  ; Joe: see if last two chars are CR and/or LF
  LastChar:=SubStr(Clipboard,0,1)
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  Send, ^v
  return

Open in new window

I would like to add two spaces replacement by single space.
This will allows me to remove blank lines and unwanted spaces with a single AutoHotkey.

Thank you for your help.
0
Hello experts,
I am trying to find a swift way to assign EE link option through AutoHotkey.
Here is my attempt however I don't know what is wrong.

!^u:: ;URL
Send, ^x
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
URL:=chr(34) & Clipboard & chr(34) 
LinkPrefix:="[url="
LinkSuffix:="url][/url]"
LinkURL:=%LinkPrefix% %URL% %LinkSuffix%
Send, %LinkURL%
Sleep, 50
Send, {End}
Sleep, 50
Return

Open in new window


Could you please help to revise the script?
Thank you for your help.
0
Hi Experts,

Is anyone aware of any method aside from 3rd party tools, SCCM, etc., to monitor Office 2016/365 applications on a workstations?

Example, I have a Windows 10 workstation, I'm looking to see if any of the office apps, word, excel, outlook have been launched in the past 30 days.

I'm running Click to run and shared activation mode for licensing.

Thanks!
0

Scripting Languages

27K

Solutions

21K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.