We help IT Professionals succeed at work.

Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.

Hello:

I have tried several different ways of combining my two CTEs within one "UNION ALL" statement but am having no luck.

How do I modify my syntax below to accomplish this?

Thank you!

Software Engineer

; with wip as 
(
select NULL as [LOTSEQNBR], FG.BatchNo as [FGBATCH], FG.FormulaId as [FG], FG.[Labor Cost] as [FGLABOR], FG.[OverHead Cost] as [FGOH], 
FG.[Material Cost] as [FGMAT], FG.[Labor Cost] + FG.[OverHead Cost] + FG.[Material Cost] as [FGCOST], FG.[TotalFGWeightYielded] as [FGWEIGHT], 
FG.[Labor Cost]/FG.[TotalFGWeightYielded] as [LABORLB],
FG.[OverHead Cost]/FG.[TotalFGWeightYielded] as [OHLB],
FG.[Material Cost]/FG.[TotalFGWeightYielded] as [MATLB],
NULL as [FORMULA], NULL as [FORMULAMAT], NULL AS [FORMULALABOR], NULL AS [FORMULAOH], NULL AS [Component], NULL as [LOT], NULL as [LOTQTY], 
NULL as [LOTMATUNITCOST], NULL as [LOTMATWIPCOST]
from BM_View_Dashboard_ProductionCostAnalysis FG
INNER JOIN BM010115 BOM ON FG.FormulaId = BOM.PPN_I
where FG.FormulaId = '506' and FG.BatchNo = '50418G12D' and BOM.SUBCAT_I = 1)
select [LOTSEQNBR], [FGBATCH], [FG], [FGLABOR], [FGOH], [FGMAT], [FGCOST], [FGWEIGHT], [LABORLB], [OHLB], [MATLB], [FORMULA], [FORMULAMAT], [FORMULALABOR], 
[FORMULAOH], [Component], [LOT], [LOTQTY], [LOTMATUNITCOST], [LOTMATWIPCOST],
[LABORLB]*[LOTQTY] as [LOTLABORWIPCOST],
[OHLB]*[LOTQTY] as [LOTOHWIPCOST]
from wip
; with wiplot as 
(
select * from (
select DISTINCT LOT.SLTSQNUM AS [LOTSEQNBR], NULL as [FGBATCH], NULL as [FG], NULL 

Open in new window

0
Sending text message for free?

I saw a price by Twilio to send text message for $75 per 100 message sent. But, this kills my business model.

Anyone know of a service that can sent Text Message for far less?

Thanks.
0
Hi:

Below are three blocks of T-SQL code, each followed by an image of the records retrieved from the specific block above it.

I'm trying to develop a manufacturing "Work in Process" report showing data from the PNMAST table  where the data in the BM010115.CPN_I field is in the BM010115.PPN_I field and BM010115.SUBCAT_I = 1.

Please help me modify the syntax of the first T-SQL code block - after its UNION ALL clause - to accommodate this.

The main thing is that I don't want 506 as the FormulaId of the PNMAST table.

Finally, please keep in mind that the images that I have attached are simply the first few records of the tables and not all of the hundreds or even thousands of records in those tables/.

Thank you!

Software Engineer


select NULL as [LOTSEQNBR], FG.BatchNo as [FGBATCH], FG.FormulaId as [FG], FG.[Labor Cost] as [FGLABOR], FG.[OverHead Cost] as [FGOH], FG.[Material Cost] as [FGMAT], 
FG.[Labor Cost] + FG.[OverHead Cost] + FG.[Material Cost] as [FGCOST],
NULL as [FORMULA],
NULL as [FORMULAMAT], NULL AS [FORUMLALABOR], NULL AS [FORMULAOH],
NULL AS [Component], NULL as [LOT], NULL as [LOTQTY], NULL as [LOTUNITCOST]
from BM_View_Dashboard_ProductionCostAnalysis FG
INNER JOIN BM010115 BOM ON FG.FormulaId = BOM.PPN_I
where FG.FormulaId = '506' and FG.BatchNo = '50418G12D' and BOM.SUBCAT_I = 1
UNION ALL
select DISTINCT NULL as [LOTSEQNBR], NULL as [FGBATCH], NULL as [FG], NULL as [FGLABOR], NULL as [FGOH], NULL as [FGMAT], NULL as [FGCOST], 

Open in new window

0
I have updated my android studio from a version 2, to the newer version 3.6.1.
When I loaded my existing project into the newer version of Android studio, the gradle would no longer sync correctly. I am getting the error

"Gradle sync failed: Could not find method google() for arguments [] on repository container.
                  Consult IDE log for more details (Help | Show Log) (7 s 47 ms)"

I cannot seem to find a solution that works to resolve this error so that I can continue working on the project? Any help is appreciated.
0
Need automated collection of news by keyword

I urgently need to find news services where I can subscribe and get news relating to CoronaVirus. Know of any?

I also know that Yahoo! News allows me to pick a keyword. Know of any others?

Lastly, for the longer term, I plan to invest some development energy into build more automated tools, which I assume would use Artificial Intelligence.

Any such tools or technologies come to mind?

Thanks
0
Hello experts,

Following the question: Question 29174017 I would like to set up a GUI with the following need:
-Based on a clipboard selected display a GUI in which I will be able to report specific string and modulate each line with the following modes:
-Keep: Find the first occurrence of the string reported in each line of clipboard, retains that first occurrence of the string reported and everything in each line of the clipboard that is after it.
Remove: Find the first occurrence of the string reported in each line of clipboard, retains that first occurrence of the string reported and everything in each line of the clipboard that is prior to it.

I attached my first attempt.

1.Could you please let me know your expertise concerning the coding structure.
2.Let me know if there is a best approach to report the example in text instruction such as reduce the font or bold specific text. I don’t know if this is possible.
3.Analyse the feasibility to add an additional radio mode related to keep lines not concerned.
The idea will be to remove or to keep the various lines of the clipboard that doesn't contain the string reported. With the current version nothing is done, they remain in the clipboard. I was wondering if we can add a mode to keep them or remove them.

Thank you for your help.
KeepRemoveBasedOnString.ahk
0
Hello experts,

The following statement allows me to retain strings from an specific column in VBA:

    For lngRow = 1 To lngLastRow
        intPos = InStr(1, UCase(Cells(lngRow, strCol).Value), strPrefix)
        If intPos > 0 Then
            Cells(lngRow, strCol).Value = Trim(Mid(Cells(lngRow, strCol).Value, intPos))
        End If
    Next

Open in new window


strPrefix is the string that is reported in a Msgbox.

I was wondering which function/process should I use in AutoHotkey to cover this need.

The final objective is to set up a GUI in which I should report the string involved in the process. Paste the clipboard with the revised text.

Example:

I have the following lines:
testid45
titiid46
test47

If I report as prefix id, I should get:
id45
Id46
 
Any advice, will be really appreciated.

Thank you for your help.
1
Hello Experts,

I was wondering if there is a way in AutoHotkey to get size of an specific folder reported.

The idea is the following:
1.Report the folder that you want to get the size through a GUI
2.Two alternatives, display a Msgbox with it size and send to the clipboard or generate a TempFolderSize txt file located in the folder reported in the GUI and run it. This file will contain the Folder reported in the GUI and the size.
20200226_212642.png
For the moment I am not going to analyse the recurse approach if reported folder has subfolders in order to avoid complexity

Here is my attempt of the GUI however I don't know how to tackle this with AutoHotkey. If you have some advice and proposal it would be great! Thank you very much for your help.

EnvGet,FolderPathForSizeAttribute,UserProfile
AddTextEditWidth:=400 ; Text specific with
Gui,Add,Text,,Report the folder in order to get it size
Gui,Add,Edit,vFolderPathForSizeAttribute cPurple w600 xm,%FolderPathForSizeAttribute%\Downloads
Gui,Add,Button,xm gButtonOKSizeAttribute Default,&OK ;Button Ok
Gui,Add,Button,x+10 gButtonCancelSizeAttribute,&Cancel ;Button Cancel
Gui,Show,,Folder size attribute
Return
ButtonOKSizeAttribute:
Gui,Submit
Gui,Destroy
ButtonCancelSizeAttribute:
Gui,Submit
Gui,Destroy

Open in new window

0
Hello experts,

The following AutoHotkey allows me to list files & folders attributes (question related: Question 29172877)

I have a little issue.
File listing is generating however the action related to open the file with excel is not performed and at the end of the AutoHotkey script I have the following20200225_121352-screenshot.pngAutoHotkey script:
;====================================
;Gui: list files and folders attributes
;====================================

^+f::
If (WinExist("File Listing"))
{
  MsgBox,4112,Error,File Listing dialog is already open
  Return
}
EnvGet,FolderPath,UserProfile
Gui,Add,Edit,vFolderPath cPurple w570 xm,%FolderPath%\Downloads
Gui,Add,Button,x+10 +Default vBrowseFolder gBrowseFolder,&Browse
Gui,Add,Text,xm,If you want a different folder, type/paste into the field above or click the Browse button on the right above and navigate to the folder
Gui,Add,Text,,Select folders to process:
Gui,Add,Radio,Checked vRecurse,&Recurse
Gui,Add,Radio,x+10,&NoRecurse
Gui,Add,Text,xm,Select filename information to put in file listing:
Gui,Add,Radio,Checked vFileInfo,&Without path without date
Gui,Add,Radio,x+10,With &Path without date
Gui,Add,Radio,x+10,Without path with &Date
Gui,Add,Radio,x+10,With &Both path and date
Gui,Add,Button,xm gButtonOKFilesFoldersListing Default,&OK
Gui,Add,Button,x+10 gButtonCancelFilesFoldersListing,&Cancel
Gui,Show,,File Listing
Return

Open in new window

0
Hello experts,

I am trying to set up an AutoHotkey script that I will use on a regular basis to swiftly export file as Pdf and open folder in which it has been saved


I need some advice with the following:
1.      Coding structure and optimization proposal.
2.      Line 6 to 8 are required?
3.      Set up a return if active document has not been saved.
Example: I open a document and I forgot to save the document. If I launch the script an if statement should be set up to block the pdf export.
4.      Find the right saveas method for powerpoint and excel the save as method applied doesn't work. File is exported however When I open the file I got an error message.
5.      End the script by opening the pdf export file
6.      Find a method to applied the same mechanism for outlook>emails
If some requirements are complicated to cover I am willing to give up
If you have questions, please contact me.
SaveAsPdfSwitchCase.txt
1
Hello experts,

I have in my AutoHotkey/Hotstring file multiple hotstrings that sendinput date.

I would like to convey them into a single hotstring and modulate them through a GUI.

The idea is the following:

 20200218_042035.png
Could you please help me to:

Set up the process behind to sendinput based on the selection.
I attached current version.

Thank you for your help.
DatesGui.ahk
1
Hello experts,

The following AutoHotkey script allows me to list files and folders based on folder reported.

;====================================
;Gui: list files and folders attributes
;====================================

^+f::
Gui,Add,Text,xm,Select folder for file listing:
Gui,Add,Edit,vFolderPath w400
Gui,Add,Text,,Select folders to process:
Gui,Add,Radio,Checked vRecurse,&Recurse
Gui,Add,Radio,x+10,&NoRecurse
Gui,Add,Text,xm,Select information to put in file listing:
Gui,Add,Radio,Checked vFileInfo,&Filename (without path)
Gui,Add,Radio,x+10,Filename with &Path
Gui,Add,Button,xm gButtonOKFilesFoldersListing Default,&OK
Gui,Add,Button,x+10 gButtonCancelFilesFoldersListing,&Cancel
Gui,Show,,File Listing
Return

ButtonOKFilesFoldersListing:
Gui,Submit
If (SubStr(FolderPath,0,1)!="\")
  FolderPath:=FolderPath . "\"
FormatTime,CurrentDateTimeFilesFolders,,yyyyMM
TempFile:=FolderPath . CurrentDateTimeFilesFolders . "_listing.txt"
FileList:=""
If (Recurse=1)
{
		LoopMode:="FDR"
}
Else
{
		LoopMode:="FD"
}
FileList:=""
Loop,Files,%FolderPath%*.*,%LoopMode%
{
  If (FileInfo=1)
		{
    FileList:=FileList . A_LoopFileName . "`n"
  }
		Else
		{
    FileList:=FileList . A_LoopFileFullPath . "`n"
		}
}
Msgbox,,,LoopMode:%LoopMode% `nFileInfo:%FileInfo%
Clipboard:=FileList
ClipWait,2 ; wait for information to appear on clipboard
If (ErrorLevel=1)
{
		MsgBox,4144,Error,No text appearing after 2 seconds
		Return
}
Sort,FileList
FileDelete,%TempFile%

Open in new window

1
Hello experts,
I am trying to set up a file listing through an AutoHotkey GUI.
Here are the requirements:
Through a GUI report folder path in which will be generated the file.
List files in a new file and open it.
The final need is to add the following new features:
-File name and file full path differentiation
-Immediate and recurse differentiation
I am quite sure that the best approach for this is radio. However prior to propose something I would like to know:-
-If code structure is ok or should I review it.
-What is the best option to create the 2*2 differentiation.
Functions with switch case?
The differentiation is based on the:
Loop, Files, %FolderPath%\*.*, FD, R ; for recurse, blank for immediate
FileList = %FileList%% A_LoopFileName %`n; for file name
FileList = %FileList%% A_LoopFileFullPath %`n; for file full path

I am aware that I need to do some file tuning and add the controls. However I will do it following your recommendations.

I attached my initial version.

Thank you for your help.
AppendFilesList.ahk
1
Hello experts,

I am trying to find a mechanism through AutoHotkey=>Gui to repeat reported text based on iterations.
Here is my attempt:

Gui, Add, Text,,Text to iterate:
Gui, Add, Text,, Number of iterations:
Gui, Add, Edit, vTextReported ym  ; The ym option starts a new column of controls.
Gui, Add, Edit, vIterationsReported
Gui,Add,Button,xm gButtonOKEx Default,&OK
Gui,Add,Button,x+10 gButtonCancelEx,&Cancel
Gui, Show,, Iterate text
Return

ButtonOKEx:
Gui, Submit
Loop, Parse, TextReported, `n, `r
{
	TextReported2:=A_LoopField . "`n"
}
TextReported3:=RepeatText(TextReported2, IterationsReported)
MsgBox,,,%TextReported3%
Clipboard:=TextReported3
ClipWait,2 ; wait for information to appear on clipboard
If (ErrorLevel=1)
{
	MsgBox,4144,Error,Information did not appear on clipboard after two seconds
	Return
}
ButtonCancelEx:
Gui,Destroy
Return

;====================================
;Function used to repeat string
;====================================

RepeatText(string,times)
{
	loop %times%
		output .= string
		return output
}

Open in new window


Could you please provide some advice on the following:
1.Is there a better approach to repeat text? If so could you please help me to set up a function
2.Controls to set up can be related to text reported. If TextReported="" return? and if IterationReported is not numeric return? For the second I need a check through var is type as reported at:
here
or another approach is better?
3.I would like to modulate the repeat action with two options, repeat text at the same line or in a new line ie : TextReported2:=A_LoopField . "`n" to have text repeat in another line or through TextReported2:=A_LoopField .  A_Space to have it in the same line. Gui Radio is the best option to cover this need?
4.If you have some advice on the AutoHotkey structure reported above, please let me know.

Thank you in advance for your help.

Regards,
Luis.
1
Hello experts,

I set up the following AutoHotkey script in order to retain or remove lines from a clipboard based on string reported in the GUI.

+^r::
AddTextEditWidth:=400
Gui,Add,Text
Gui,Add,Text,xm,Which operation to you want to performed?
Gui,Add,Radio,Checked vWhichOp xm,Retain
Gui,Add,Radio,x+20,Remove
Gui,Add,Text
Gui,Add,Text,xm,Enter the string related to retain or remove operation (or click Cancel not to add text):
Gui,Add,Edit,vAddTextRetainRemove xm w%AddTextEditWidth%
Gui,Add,Text
Gui,Add,Button,xm gButtonAddTextRetainRemoveOK Default,&OK
Gui,Add,Button,x+10 gButtonAddTextRetainRemoveCancel,&Cancel
Gui,Show,,Add text
Return

ButtonAddTextRetainRemoveOK:
Gui,Submit
Gui,Destroy
Send, ^c
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error,No text appeared on clipboard after initial Ctrl+c and waiting for one second
  Return
}
Else
ReferenceString:=AddTextRetainRemove
NewClipboardVar:=""
Loop,Parse,Clipboard,`n,`r
If (WhichOp=1) 
{
  If InStr(A_LoopField, ReferenceString)
    NewClipboardVar:=NewClipboardVar . A_LoopField . "`n"
}
Else
{
  If InStr(A_LoopField, ReferenceString)
    Continue
    NewClipboardVar:=NewClipboardVar . A_LoopField . "`n"
}
LastChar:=SubStr(NewClipboard,0,1) ; see if last char is CR or LF
If ((LastChar="`r") or (LastChar="`n"))
{
  StringTrimRight,NewClipboard,NewClipboard,1 ; last char is CR or LF - remove it
  LastChar:=SubStr(NewClipboard,0,1) ;  see if new last char is CR or LF
  If ((LastChar="`r") or (LastChar="`n")) ;
    

Open in new window

1
Hi,
I have the following and cannot show user name and password in center of lines. Please help.
<html>
    <body>
        <!--div align="center"-->
        <div class="container" style="background:url('./pict/ID-10028343.jpg') no-repeat center top; Height:780px; Width:1220px; background-size:100% 100%; margin:0 auto; ">
            <form action="page.php" method="POST">
    <script src="Scripts/jquery-3.0.0.min.js"></script>
    <script src="Scripts/bootstrap.min.js"></script>
    <link href="Content/bootstrap.min.css" rel="stylesheet" />
    <style>
        input {
            background-color: 00008B;
            width: 200px;
            display: block;
        }
        div {
            margin:10px auto;
        }
    </style>
    <div class="container">
            <div class="d-flex justify-content-center">
                <b>Username:</b><input type="text" name="username" /><br />
            </div>
            <div class="d-flex justify-content-center">
                <b>Password:</b><input type="password" name="password" /><br/>
            </div>
        </div>

                <input type="submit">
            </form>
        </div>
    </body>
</html>

Open in new window

0
Hello experts,

The following AutoHotkey allows me to add line number based on selection.

;====================================
;Add line numbers at the beginning of each line
;====================================
#If (!WinActive("ahk_exe excel.exe"))
^+l:: ; Ctrl+Shift+L - as always, make it whatever you want
SkipBlankLines:=True
MsgBox,4131,Do you want to number blank lines?,Press YES to number the blank lines`n`nPress NO not to number the blank lines`n`nPress CANCEL to exit/quit (not do any numbering)
IfMsgBox,Cancel
  Return
IfMsgBox,Yes
  SkipBlankLines:=False
Sleep, 50
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
LineNum:=0
ClipboardVar:=Clipboard
UpdatedLines:=""
Loop,Parse,ClipboardVar,`n,`r
{
  If ((A_LoopField="") and (SkipBlankLines))
    LineNumOut:=""
  Else
  {
    LineNum:=LineNum+1
    LineNumOut:=LineNum . "."
  }
  UpdatedLines:=UpdatedLines . LineNumOut . A_LoopField . "`n"
}
LastChar:=SubStr(UpdatedLines,0,1) ; see if last char is CR or LF
If ((LastChar="`r") or (LastChar="`n"))
{
  StringTrimRight,UpdatedLines,UpdatedLines,1 ; last char is CR or LF - remove it
  LastChar:=SubStr(UpdatedLines,0,1) ;  see if new last char is CR or LF
  If ((LastChar="`r") or (LastChar="`n")) ;
    StringTrimRight,UpdatedLines,UpdatedLines,1 ; new last char is CR or LF - remove it
}
Clipboard:=UpdatedLines
Sleep, 50
Send, ^v
Return
#If

Open in new window


I would like to take as a reference to cover the following need:
1.Display a msgbox or a Gui with two options: 1 add string at the beginning 2 at the end
2.Display a second inputbox to report the string to add
3.Insert the string and replace the selection by revised text
Example:
1.I select the following text:
Text text
Text text
Text text
2.I Select 1 for adding text at the beginning
3.I enter the following string: 20200203_163112
4.The previous text will be replaced as following:
20200203_163112Text text
20200203_163112Text text
20200203_163112Text text

If you have questions, please contact me.

Thank you for your help.
0
Hi,
Jpg file does exist in "/var/www/pict" path, but html file below is not able to show Jpg file. Why?

<html>
    <body>
        <!--div align="center"-->
        <div class="container" style="background:url('../pict/ID-10028343.jpg') no-repeat center top; Height:780px; Width:1220px; background-size:100% 100%; margin:0 auto; ">
        ...

Open in new window

0
Hello experts,

I have the following AutoHotkey to open my AutoHotkey file.

;====================================
;Open AutoHotkey file
;====================================
#If (!WinActive("ahk_exe excel.exe") or (!WinActive("ahk_exe SciTE.exe")))
+F2::
AhkFile:=A_ScriptFullPath
If (FileExist(SciTE1))
  Run, "%SciTE1%" "%AhkFile%"
Else
If (FileExist(SciTE2))
  Run, "%SciTE2%" "%AhkFile%"
Else
  MsgBox,4112,Error,Neither SciTE exists on your system.
Return
#If

Open in new window


I don't understand why the restriction is not applied when I launch the script from excel or SciTe.

The restriction works when I launch the AutoHotkey script from excel:

;====================================
;Open AutoHotkey file
;====================================
#If (!WinActive("ahk_exe excel.exe"))
+F2::
AhkFile:=A_ScriptFullPath
If (FileExist(SciTE1))
  Run, "%SciTE1%" "%AhkFile%"
Else
If (FileExist(SciTE2))
  Run, "%SciTE2%" "%AhkFile%"
Else
  MsgBox,4112,Error,Neither SciTE exists on your system.
Return
#If

Open in new window


Thank you for your help.
0
Hello Experts,

The following AutoHotkey function allows to select files attributes / components.
GetSelectedFile(hwnd:="",FileComponents:=1,GetDate:=1) {
; this function by sinkfaze: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=77#p395
  WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
  WinGetClass class, ahk_id %hwnd%
  if  (process = "explorer.exe")
    if  (class ~= "Progman|WorkerW") {
      ControlGet, files, List, Selected Col1, SysListView321, ahk_class %class%
      Loop, Parse, files, `n, `r
        ToReturn .= A_Desktop "\" A_LoopField "`n"
    }
    else  if (class ~= "(Cabinet|Explore)WClass") {
      for window in ComObjCreate("Shell.Application").Windows
        if  (window.hwnd==hwnd)
          sel :=  window.Document.SelectedItems
      for item in sel
      {
        FileFullPath:=item.path
        If (FileComponents=1)
          FileParts:=FileFullPath
        If (FileComponents=2)
          SplitPath,FileFullPath,,,,FileParts
        If (FileComponents=3)
          SplitPath,FileFullPath,FileParts
        If (GetDate>1)
        {
          ToReturn .= DateParse(item.ModifyDate) . A_Tab . FileParts . "`n"
          If (GetDate=2)
            Sort,ToReturn ; GetDate=2 --> modified date sorted ascending
          Else
            Sort,ToReturn,R ; GetDate=3 --> modified date sorted descending
        }
        else
          ToReturn .= FileParts "`n" ; GetDate=1 --> no date/sort
      }
    }
    return  

Open in new window

0
Hi,
Is there any good converter or site to change PDF to Word file?

Is there good sharing to do the same by C#/Java, in programmable way?
0
Hello experts,

The following AutoHotkey related to the article: https://www.experts-exchange.com/articles/29416 allows me to copy link to clipboard.

F5::
WinGetTitle,ActiveTitle,A ; get title of active window
IfInString,ActiveTitle,Mozilla Firefox ; check if active window is Firefox
 ShortcutKey:="a" ; send letter "a", Firefox shortcut for Copy Link Location
Else ; it is not Firefox
IfInString,ActiveTitle,Google Chrome ; check if active window is Chrome
 ShortcutKey:="e" ; send letter "e", Chrome shortcut for Copy Link Address
Else ; it is not Chrome
IfInString,ActiveTitle,Internet Explorer ; check if active window is IE
 ShortcutKey:="t{Enter}" ; send letter "t", IE shortcut for Copy Shortcut, but also needs Enter
Else ; it is not IE
IfInString,ActiveTitle,Opera ; check if active window is Opera
 ShortcutKey:="e" ; send letter "e", Opera shortcut for Copy Link Address
Else ; it is not Opera
{
 MsgBox,4112,Error,Active window is not a supported browser.
 Return ; 4112 above means put dialog on top and give it the red X (error/stop) icon
}
Clipboard:="" ; empty the clipboard
MouseClick,Right ; right-click at current mouse location
Sleep,60 ; wait for 60 milliseconds to make sure context menu is there
SendInput,%ShortcutKey% ; send shortcut to copy link
ClipWait,2 ; wait at most 2 seconds for short link to appear in clipboard
If (ErrorLevel=1) ; ErrorLevel set to 1 when wait period expires
{
 

Open in new window

0
Hello experts,

The following AutohotKey scripts allows me to copy files attributes based on selected files
;====================================
;Copy files attributes
;====================================

+F1::
Gui,Add,Radio,Checked vComponents xm,FileNoPathWithExt
Gui,Add,Radio,x+20,FileNoPathNoExt
Gui,Add,Radio,x+20,FileFullPath
Gui,Add,Button,xm Default,&OK
Gui,Add,Button,x+20,&Cancel
Gui,Show,,Copy to Clipboard
Return

ButtonOK:
Gui,Submit
Gui,Destroy
If (!WinActive("ahk_class CabinetWClass"))
{
  MsgBox,4144,Error,Active window is not Windows/File Explorer
  Return
}
AllFileComponents:=""
SelectedFiles:=GetSelectedFile("",False)
If (SelectedFiles="")
{
  MsgBox,4144,Error,No files are selected in Windows/File Explorer
  Return
}
Switch Components
{
  Case 1:
  Loop,Parse,SelectedFiles,`n,`r
  {
    FileFullPath:=A_LoopField
    SplitPath,FileFullPath,FileNoPathWithExt
    AllFileComponents:=AllFileComponents . FileNoPathWithExt . "`n"
  }
  Case 2:
  Loop,Parse,SelectedFiles,`n,`r
  {
    FileFullPath:=A_LoopField
    SplitPath,FileFullPath,,,,FileNoPathNoExt
    AllFileComponents:=AllFileComponents . FileNoPathNoExt . "`n"
  }
  Case 3:
  Loop,Parse,SelectedFiles,`n,`r
  {
    FileFullPath:=A_LoopField
    AllFileComponents:=AllFileComponents . FileFullPath . "`n"
  }
}
Clipboard:=AllFileComponents
ClipWait,2 ; wait for information to appear on clipboard
If (ErrorLevel=1)
  MsgBox,4144,Error,Information did not appear on clipboard after two seconds
Return

Open in new window

0
Hello experts,

The following AutoHotkey scripts allows me to remove extra lines and extra spaces:
;====================================
;Remove two consecutive extra lines
;====================================

^!Space::
Send ^c
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error,No text appeared on clipboard after initial Ctrl+c and waiting for one second
  Return
}
PreviousLineBlank:=False
NewClipboard:=""
Loop,Parse,Clipboard,`n,`r
{
  CurrentLine:=A_LoopField
  CurrentLineWithoutBlanks:=StrReplace(CurrentLine,A_Space) ; remove all spaces
  CurrentLineWithoutBlanks:=StrReplace(CurrentLineWithoutBlanks,A_Tab) ; remove all tabs
  If (CurrentLineWithoutBlanks="") ; see if current line is blank
  {
    If (PreviousLineBlank) ; current line is blank - see if previous one is
      Continue ; a consecutive blank line, so do not include it
    Else
    {
      NewClipboard:=NewClipboard . CurrentLine . "`n" ; not a consecutive blank line, so include it
      PreviousLineBlank:=True
    }
  }
  Else
  {
    NewClipboard:=NewClipboard . CurrentLine . "`n" ; current line is not blank, so include it
    PreviousLineBlank:=False
  }
}
LastChar:=SubStr(NewClipboard,0,1) ; see if last char is CR or LF
If ((LastChar="`r") or (LastChar="`n"))
{
  StringTrimRight,NewClipboard,NewClipboard,1 ; last char is CR or LF - remove it
  LastChar:=SubStr(NewClipboard,0,1) ;  see if new last char is CR or LF
  If ((LastChar="`r") or (LastChar="`n")) ;
    

Open in new window

0
Hello experts,

The following AutoHotkey script allows me to add specific character at the beginning of each line:

;====================================
;Add specific character at the beginning of each line
;====================================

^+-::
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
UpdatedLines:=""
Loop,Parse,ClipboardVar,`n,`r
  UpdatedLines:=UpdatedLines . "-" . A_LoopField . "`n"
Clipboard:=UpdatedLines
Sleep, 50
Send, ^v
Return

Open in new window



I was wondering if I can take as a reference to add line number for each line.

Example:

I have the following text block:

text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text

-I select the text
-I launch the AutoHotkey script and I expect to have the following:

1.text text text text text text text text text text text text text
2.text text text text text text text text text text text text text text text text
3.text text text text text text text text text text text text text text text text text

If you have questions, please contact me.

Thank you for your help.
0

Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.