topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 18, 2019, 12:11 PM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nod5 [ switch to compact view ]

Pages: [1] 2 3 4 5 6 ... 39next
1
Find And Run Robot / Re: displaying long file names
« on: August 07, 2019, 05:08 PM »
I can confirm that the word wrap happens, though I hadn't noticed it until you posted about it. Don't know if there is a way to disable it.
longfilename.png

2
Something a bit like this https://www.instruct...-Pi-Doves-Repellent/ ?

Turning a light source on/off and moving small servo motors is quite easy with a Raspberry Pi. There are a lot of tutorials on that online. My advice is that you first figure out what type of sound/light/movement is sufficient to repel the birds in the location you have in mind. Once you have that more detailed you can work out what kind of hardware/software you need. Perhaps a simple PIR movement sensor is enough as a reliable detector, rather than more complex machine learning and computer vision software?

3
General Software Discussion / Re: Mozilla shoots itself in foot
« on: May 05, 2019, 02:28 PM »
https://blog.mozilla...-add-ons-in-firefox/
A Firefox release has been pushed — version 66.0.4 on Desktop and Android, and version 60.6.2 for ESR. This release repairs the certificate chain to re-enable web extensions, themes, search engines, and language packs that had been disabled (Bug 1549061). There are remaining issues that we are actively working to resolve, but we wanted to get this fix out before Monday to lessen the impact of disabled add-ons before the start of the week. More information about the remaining issues can be found by clicking on the links to the release notes above. (May 5, 13:22 EDT)

Seems like a reasonable approach. They've now had more time to test the update. The release allegedly patches (most of) the issues which should go some ways to mitigate negative impact on users who rely on Firefox on work/school weekdays.

4
General Software Discussion / Re: Mozilla shoots itself in foot
« on: May 05, 2019, 03:22 AM »
Big mess this!

Ghacks is a good site, but a bunch of people in the comments section there tend to be weirdly, toxically negative against all things Mozilla/Firefox.

Two more direct sources to monitor for news until a more permanent fix is out:
https://blog.mozilla...-add-ons-in-firefox/
https://twitter.com/mozamo

https://twitter.com/.../1124882998984204288
We are really, really sorry for the continued disruption of features that you love and trust. We know this has been frustrating, and we're committed to fixing this as fast as we possibly can.

https://twitter.com/.../1124879521750978560
Hi folks, our team has been working around the clock for the last 24 hours to get your extensions back up and running. Unfortunately, we don't have a permanent fix ready to be released.

We're going to hold off on trying to push a permanent fix tonight (Pacific time) and give our engineers a chance to breathe while our QA team runs a more complete battery of tests on the updated builds.

5
Find And Run Robot / Re: Use of Variables inside Aliases
« on: April 28, 2019, 03:35 AM »
I think I should be able to fix your problem -- sounds like it's just a matter of the order that FARR replaces variables and regex values, and that regex $$n values should be resolved first.

Consider adding a list with the resolving order to the helpfile after the changes. Things that might resolve in some order or other:  %uservar.myvar.hundred% variables, $$1 regex matches, the new fileresults command, the older #filecontents command.

Helpfile says that #filecontents can be used recursively (haven't tried it) so FARR already resolves at least the string "#filecontents" for that command. But does/should #filecontents and fileresults commands also resolve %uservar.myvar.hundred% and $$1 in the file contents and if yes in what order?

Hypothetical, overly complex edge case example
- User types input that triggers a FARR alias with RegEx that puts the string "file" in $$1 and "cool" in $$2
- The alias has this results line:
fileresults C:\folder\%uservar.myvar.$$1%.txt
- with the suggested change in this thread that line would first resolve to
fileresults C:\folder\%uservar.myvar.file%.txt
- imagine the variable %uservar.myvar.file% contains string "testingfile", we then get
fileresults C:\folder\testingfile.txt
- imagine that file contains:
#$$1contents C:\folder\results.txt
- which, if command fileresults resolves $$1, will resolve to the command
#filecontents C:\folder\results.txt
- imagine that file in turn contains
C:\here\%uservar.othervar.$$2%.txt
- which, again if command #filecontents also resolves $$1 and % variables, resolves to
C:\here\%uservar.othervar.cool%.txt
- which, imagine, resolves to
C:\here\final_file.txt
- which contains
Spoiler
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

:P


6
Find And Run Robot / Re: Use of Variables inside Aliases
« on: April 27, 2019, 06:32 AM »
Just to add to mouser's suggestion:
You can use the list approach together with RegEx and RegEx result filter to ensure that only the list items are shown in results, and filtered as you type. Without RegEx unwanted files that contain the keyword string might also show up in the results.

Example of what I mean with RegEx result filter:
1.png

With the above you'd type "gg" to get the whole list and nothing else. Then keep typing to filter the list.

7
Find And Run Robot / Re: Use of Variables inside Aliases
« on: April 26, 2019, 04:29 PM »
I don't know of any workaround to do exactly what you want to do. But perhaps mouser does.

Anyway I like that you're new to FARR but already push the boundaries :Thmbsup: Aliases are powerful so maybe there is is some other way to achieve the end goal you're after. Could you tell more about the use case?

8
@4wd: I took MourningStar to want to apply the exact context menu verb on the selected files. That will sometimes be different from passing a textfile with filepaths to the target application. But if the applications they want to use this on have command line equivalents for each of the wanted verbs then your approach, if we add an extra step constructing the command line argument, is an alternative way to do it.

edit:
Doh! You already made my point. Or rather I repeated yours.
passed to the end program, (or intermediate cmd file if the program can't take text list input).
I suppose I'm standing on the shoulders of 4WD giants 8)

9
I understand correctly using your code/script/app would depend on another code/script/app in order to produce a one press operation
-MourningStar (April 05, 2019, 12:32 PM)
From what I can tell, yes. You'd use for example AutoHotkey to create a script with a hotkey that when pressed causes the script to
1. get the filepaths of the currently selected files in the active File Explorer window, and
2. run cautomaton32 on the command line with a verb (that you've previously manually looked up and added to the code) and the filepaths as parameters

You'd create one such hotkey for each target application (wmp, winamp, ...) you want to send files to using some context menu verb.

Alternatively the AutoHotkey function InvokeVerb() can replace step 2 , https://sites.google...functions/invokeverb

edit: the function only works on one single file or one whole folder at a time. We can apply it in a loop over each of the selected files. But that might not have the same effect as manually selecting some files, right clicking and choosing a verb. For example we might end up starting three instances of a media player rather than starting one instance and adding three files to its playlist. Relevant (unsolved) StackOverflow issue: https://stackoverflo...ia-shell-application

I think the chance of someone completing your request might increase if you provide more details. What are the exact names of applications you want to send files to with a hotkey? For each such application, what is the name of the its context menu verb that you want to trigger?

10
Non-Windows Software / Re: git9 - A Git file system for Plan 9
« on: April 15, 2019, 04:40 PM »
I'm not sure. I know nothing beyond wikipedia about Plan 9 (have seen parts of the film though!  ;D). Do you use it and in what way will this new development make it better to use?

11
Non-Windows Software / Re: git9 - A Git file system for Plan 9
« on: April 15, 2019, 02:12 AM »
EIL5

12
Living Room / Re: I'm getting married, wish me luck!
« on: April 15, 2019, 02:08 AM »
Waaay too late
-ScreenManiac (March 10, 2019, 10:59 AM)
Hold my beer!  :)

Great to hear this mouser. Congratulations to both of you!

13
Post New Requests Here / Re: IDEA: Subfolder Creator
« on: April 15, 2019, 02:02 AM »
At present it is for downloaded newspaper pages, where they may not be sequentially named. So dropping into the right folder allows for a subsequent quick rename using the folder as the new filename. Only 150 years of a weekly papers to work through.

Wow, that's a lot! :)

If you're downloading the pages for one paper issue in the right sequence and without gaps (download page 1 first, then page 2, ...) you might be able to rename in one go with a script that reads the "date modified" metadata. At least if there is reliably one or more second time difference between each download. See variable A_LoopFileTimeModified for Loop command.

14
Post New Requests Here / Re: IDEA: Subfolder Creator
« on: April 14, 2019, 05:37 AM »
You've enhanced the program to accept multiple folder drops at once - nice going!  :)

Tip: when you add code to a forum post use the "code highlighting" dropdown to colorize the AutoHotkey code, like in my posts.

In my working version I have moved the box creation to the top which seems to work, but is there a reason not to do this?
No problem in this case. But with more complex GUIs putting Show first can result in the user first seeing a blank window and only later text, buttons, editboxes. Avoided by putting Show last. Just to illustrate that try what happens if you add in a delay, like so

Code: Autohotkey [Select]
  1. Gui, Show, w300 h300, Subfolder Creator
  2. Sleep 700
  3. Gui, font, s14 cBlack bold
  4. Gui, Add, Text,x150 y150,Drop folder

To me the logical progression is make a box, chose pen and ink, and write something with it.
Makes sense in the sketching/planning phase. But that can differ from what is later on the best code order. It often helps to comment (shown in green here) the code to make it more intuitive to read later. For example
Code: Autohotkey [Select]
  1. ;Main GUI window where user drops folders
  2. Gui, font, s14 cBlack bold
  3. Gui, Add, Text, x150 y150, Drop folder
  4. Gui, Show, w300 h300, Subfolder Creator

I created a gosub for folder creation and dropped it to the bottom with the appropriate entries for folder creation.
That works. Just for example, another way to do it without the gosub. Notice: continue instead of break.
Code: Autohotkey [Select]
  1.     #SingleInstance force
  2.     Gui, font, s14 cBlack bold
  3.     Gui, Add, Text,x100 y120,Drop folder
  4.     Gui, Show, w300 h300, Subfolder Creator
  5.     return
  6.      
  7.     GuiDropFiles:
  8.      Loop, parse, A_GuiControlEvent, `n, `r
  9.       {
  10.         folder := A_LoopField
  11.         if !InStr(FileExist(folder), "D")
  12.           continue
  13.          FileCreateDir, %folder%\subfolder name
  14.          FileCreateDir, %folder%\another subfolder
  15.          FileCreateDir, %folder%\subfolder 3
  16.       }
  17.     return
  18.      
  19.     GuiClose:
  20.     exitapp

Or alternatively with a function instead of gosub
Code: Autohotkey [Select]
  1.     #SingleInstance force
  2.     Gui, font, s14 cBlack bold
  3.     Gui, Add, Text,x100 y120,Drop folder
  4.     Gui, Show, w300 h300, Subfolder Creator
  5.     return
  6.      
  7.     GuiDropFiles:
  8.      Loop, parse, A_GuiControlEvent, `n, `r
  9.       {
  10.         folder := A_LoopField
  11.         if InStr(FileExist(folder), "D")
  12.           MakeFolders(folder)
  13.       }
  14.     return
  15.      
  16.     GuiClose:
  17.     exitapp
  18.  
  19. MakeFolders(folder) {
  20.   FileCreateDir, %folder%\subfolder name
  21.   FileCreateDir, %folder%\another subfolder
  22.   FileCreateDir, %folder%\subfolder 3
  23. }

One great thing with AutoHotkey is that it is relatively easy to get going with commands and make small programs. We can then gradually move from commands/gosub style coding to expressions, functions and objects as the programs get more complex.

If all your subfolder names will have an increasing pattern you can shorten code by replacing all the FileCreateDir lines with a loop

Simple example, but without padding so the folders get named p1, p2 ... rather than p01, p02 ...
Code: Autohotkey [Select]
  1. Loop, 12
  2.   FileCreateDir, %folder%\p%A_Index%
This gives padding
Code: Autohotkey [Select]
  1. Loop, 12
  2. {
  3.   if A_Index < 10
  4.     FileCreateDir, %folder%p0%A_Index%
  5.   else
  6.     FileCreateDir, %folder%p%A_Index%
  7. }
This gives padding in a shorter way by using expressions and the Format() function.
Code: Autohotkey [Select]
  1. Loop, 12
  2.   FileCreateDir, % folder "\p" Format("{1:02}", A_Index)

15
Post New Requests Here / Re: IDEA: Subfolder Creator
« on: April 13, 2019, 05:35 PM »
Ok, here is a basic version. You could enhance it in several ways: Edit the subfolder names of course; Add editboxes so the user can change subfolder names on each use; Change the color, font and look of the window; Accept dropping more than one folder at a time; and more. If you look up the commands on each line in the AutoHotkey manual you'll quickly get ideas on how to tweak things.

Code: Autohotkey [Select]
  1. Gui, font, s14 cBlack bold
  2. Gui, Add, Text,x100 y120,Drop folder
  3. Gui, Show, w300 h300, Subfolder Creator
  4. return
  5.  
  6. GuiDropFiles:
  7.  Loop, parse, A_GuiControlEvent, `n, `r
  8.   {
  9.     folder := A_LoopField
  10.     break
  11.   }
  12.   if !InStr(FileExist(folder), "D")
  13.     return
  14.    FileCreateDir, %folder%\subfolder name
  15.    FileCreateDir, %folder%\another subfolder
  16.    FileCreateDir, %folder%\subfolder 3
  17. return
  18.  

Here is how it looks in Windows 10
3.png

16
Post New Requests Here / Re: IDEA: Subfolder Creator
« on: April 13, 2019, 01:49 PM »
An example, just to see if I understand the request.

If the user drops the folder
C:\this\folder
on the GUI dropzone then the program should create
C:\this\folder\somesubfolder
C:\this\folder\anothersubfolder
C:\this\folder\third

And similarly create the same named subfolders if we drop the folder C:\other\directory and so on.

If that's it then AutoHotkey can do it.

But if you want to learn perhaps you'd like to give it a shot yourself first? Help on commands to use
https://autohotkey.com/docs/Tutorial.htm
https://autohotkey.c...ocs/commands/Gui.htm
https://autohotkey.c...Gui.htm#GuiDropFiles
https://autohotkey.c...ds/FileCreateDir.htm

17
N.A.N.Y. 2019 / Re: NANY 2019: Shorthand 3_2
« on: April 11, 2019, 07:23 AM »
Hi Maestr0, I'm learning to use Everything from within AutoHotkey so I peeked a little at your source code. I see you use ES on the command line rather than the Everything SDK/API. Was there some reason for that in this case? Speed? Stability? Other?

I have myself only very quickly tested the SDK/API so don't know what the advantages/disadvantages are in actual use.
There is sample AutoHotkey code here
https://www.autohotk...php?p=118613#p118613
and the Everything creator has well written SDK documentation here
https://www.voidtool...port/everything/sdk/

18
General Software Discussion / Re: youtube downloader?
« on: April 08, 2019, 07:44 AM »
Those using Find And Run Robot can make a simple alias for youtube-dl with settings like these:

regex: ^yt (.+)
results: youtube-dl | C:\folder\youtube-dl.exe -o C:\savefolder $$1

To use it when browsing YouTube
1. focus the browser's URL bar
2. press ctrl+C to copy the URL
3. open FARR and type "yt "
4. press ctrl+V to paste the url
5. press Enter

Even more convenient, but a bit more complex to set up, is to have an alias use AutoHotkey to grab the active browser tab URL and feeds it to youtube-dl.

19
Ok, here are .lnk files for Calculator and Xbox as generated by the StackOverflow python script.

edit: I compared the python generated Calculator shortcut with one made through the context menu in the AppsFolder (win+R and then shell:AppsFolder, right click Calculator, "create shortcut"). The two files are identical except for block (decimal)number 22, which has the value 00 in the python generated file and 08 in the other.

20
Thanks for continuing this detective work  :)

The Python script doesn't create any icon image files per se. In the hex editor the .lnk contains these relative path strings
Assets\CalculatorMedTile.png
Assets\CalculatorAppList.png
Assets\CalculatorWideTile.png
Assets\CalculatorLargeTile.png
Assets\CalculatorSmallTile.png

The matching Assets folder has for each of the above multiple .png files with the same start name then a dot and some size/color specification. For example
CalculatorAppList.contrast-black_scale-200.png
CalculatorAppList.contrast-black_targetsize-16.png
CalculatorAppList.contrast-black_targetsize-20.png
...
It looks like one or other of the .png that start with CalculatorAppList is used for the icon for the .lnk when I view it in Explorer.

But the .png in Assets are black and white while the .lnk icon is white with blue background. (But maybe the blue is dependent on some Windows theme?)

I examined a few more of the python generated .lnk in the hex editor but can't see any simple consistent pattern in the name of the .png filenames.

Anyway, recreating the look and feel of the icons in the python generated shortcuts involves both finding the right .png to use and transforming its color.

I attach one of the .png files and an overview screenshot from Explorer with many of the image files.

Shortcut files are more complicated that one might have though :o
https://github.com/l...K)%20format.asciidoc

21
what is the shortcut Target that is generated by the above script?
Does it use explorer.exe shell:.... or does it resolve to the executable?
It isn't an ordinary .lnk shortcut file. The target field is greyed out in the file properties window. This is for Calculator app:

grey.png

The target field contains only Microsoft.WindowsCalculator_8wekyb3d8bbwe!App, so the Explorer.exe shell:Appsfolder\ part from the regular shortcuts isn't there.

When I open the .lnk in HxD Hex Editor it decodes to among other things this path string
C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1902.42.0_x64__8wekyb3d8bbwe
which is a protected folder that contains these files
AppxBlockMap.xml
AppxManifest.xml
AppxSignature.p7x
Calculator.exe
CalculatorApp.winmd
resources.pri
WinMetadata
and subfolders
AppxMetadata
Assets
The .lnk file also contains strings that are paths to .png icons files in the Assets subfolder above.

I'm not familiar enough with the Windows API and python stuff in the StackOverflow code to understand what it is doing line by line.

22
Simple Powershell script
Great!

To get the script to work on my PC I had to do these things
- the multi line comments at the top gave errors, but changing /* and */ to <# and #> fixed that.
- run the cmd window as administrator
- add the Bypass argument, like so
powershell.exe -ExecutionPolicy Bypass -F C:\folder\Apps2Shortcut.ps1
Then it works and outputs .lnk shortcut files in the desktop folder "Installed-Apps". Nice!

But I can't get it to run within AutoHotkey, even as administrator. I've tried
Run powershell.exe -ExecutionPolicy Bypass -F C:\folder\Apps2Shortcut.ps1
Run powershell.exe -ExecutionPolicy Bypass -NoExit -F C:\folder\Apps2Shortcut.ps1
RunWait powershell.exe -ExecutionPolicy Bypass -NoExit -F C:\folder\Apps2Shortcut.ps1
and some other variations without success. Similarly, this and variations of it also do not work
Run powershell.exe -ExecutionPolicy Bypass -C "Get-StartApps | Out-File C:\folder\test.txt"
I don't have to use AutoHotkey of course. But remaining issues I'm trying to solve are
1. how to automatically run the script at least every time Windows starts, to keep the .lnk files up to date?
2. how to make it easy for end users (ideally not running as administrator) to set this up once and for all?
And also
3. is there some way to add the matching icons to the shortcuts?

edit:
This handles issue 1 above. Run the AutoHotkey script as administrator creates a scheduled task that in turn on each logon runs the powershell script to create .lnk files.
RunWait schtasks /Create /SC ONLOGON /TN Apps2Shortcut /TR "powershell.exe -ExecutionPolicy Bypass -F C:\folder\Apps2Shortcut.ps1"
The same task can also be created manually (and deleted if no longer needed) through the Task Scheduler (win+I and search for "schedule tasks").
Not a very end-user friendly way to set this up though.

edit2:
This Python solution works for me without running as administrator https://stackoverflow.com/a/43635956
I had to use Python 2. The .lnk shortcut files also get icons (issue 3 above).
Perhaps the approach there can be reproduced without Python.

23
Coding Snack request
a script/tool that auto creates .lnk shortcuts for all currently installed Windows Store Apps.

Background
Users of Mouser's Find And Run Robot (FARR) requested an easy way to launch Windows Store Apps. The problem is that those apps do not create .lnk shortcut files FARR can find when searching files and folders. Users can manually create .lnk shortcuts one by one. But an automated method would be more user friendly. A standalone tool could also be useful for people who don't use FARR.

Research done

1. syntax for .lnk shortcuts to Windows Store Apps

Windows Store Apps can  be run from .lnk shortcuts with a target that has this format
explorer.exe shell:Appsfolder\<AUMID>
where AUMID (Application User Model ID) is a special string for each app.
For example on my PC we can launch Windows Calculator with
explorer.exe shell:Appsfolder\Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

2. Powershell command to get a list of AUMID
The Powershell command
get-StartApps
returns a list with an App name and its associated App AUMID on each line.
More details here https://docs.microso...-of-an-installed-app

3. Making .lnk shortcuts programmatically
AutoHotkey has the command FileCreateShortcut, https://autohotkey.c...leCreateShortcut.htm

What has already been tried
I didn't find a working way to use AutoHotkey to run Powershell with the get-StartApps command and output the resulting list to a .txt file.
I get this error
'get-StartApps' is not recognized as the name of a cmdlet

Instead of banging my non-powershell experienced head more against powershell error message walls, perhaps someone else here can think of a quick fix or different solution, using AutoHotkey, Powershell or some other method?  :)

24
Find And Run Robot / Re: Launching Windows Apps
« on: March 30, 2019, 10:56 AM »
This page
https://docs.microso...-of-an-installed-app
describes a Powershell command to get a list of the names and AUMIDs (Application User Model ID) for all apps installed for the current user
get-StartApps

For example the list has this line on my PC
Calculator        Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

The string on the right is the AUMID. We can use it to start the program from a cmd window like so
explorer.exe shell:Appsfolder\Microsoft.WindowsCalculator_8wekyb3d8bbwe!App

Those are the main ingredients we need. For FARR to automatically be able to run any such app installed either of these two solutions should work

1. Mouser codes FARR to at some interval get and parse the AUMIDs list and in some special way include the app names in FARR search results so users can search for and start them

2. A separate tool is made that gets AUMIDs and for each creates a shortcut .lnk files with the application name as filename and
explorer.exe shell:Appsfolder\<AUMID>
as target. The tool runs at Windows start or every hour or some such. The user sets FARR to include that folder with the .lnk files when searching.

Alternative 2 could be a good Coding Snack challenge perhaps?

25
Cool project! It sounds a lot like a wiki when you describe it, doesn't it? I thought of something like https://gameofthrone...f_Thrones_(TV_series) . Not sure what local software is best for that sort of thing though.

If you for the time being stick with a Google Sheet type approach but want to enhance it in various ways then check out https://airtable.com/ . I like how you can make multiple filtered views for a sheet and toggle quickly between those views. Cells can also easily include image thumbnails. The free version has quite a lot of features.

Pages: [1] 2 3 4 5 6 ... 39next