How do I solve the "is not a path to a .klc file" error in Windows PowerShell when running a klc to tfl file converter script?

62 Views Asked by At

My goal is to convert a Microsoft keyboard layout file (a .klc file) into a .tfl file that I can import into type-fu.com because I'm using a custom keyboard layout that's not listed as one of the keyboard layout options on type-fu.com.

Here is the link to the GitHub repository for the Type-Fu-Layout-Format-Converter's code. I don't know if the script works, but it would be helpful if someone looked at the code and checked if the script actually works.

I opened PowerShell in Windows 11, then I typed in "powershell -ExecutionPolicy ByPass -File C:\Users\ADMIN\Downloads\klctotfl.ps1" to execute a ps1 script.

I initially got an error when I tried to use the cd. command to execute the script directly on PowerShell. The error said that scripts are disabled on PowerShell.

Then it asked for the KLC file path: "klcFilePath:". I typed in what I thought is the KLF file path, and I didn't receive an error from PowerShell: "C:\Users\ADMIN\Desktop\Organization Folders\carpalx-msklc-0.11\MSKLC\qfmlwy\qfmlwy.klc".

Then it asked for the TFL file path and I thought I should type in what I think the name of the output's file path would be: "C:\Users\ADMIN\Desktop\Organization Folders\carpalx-msklc-0.11\MSKLC\qfmlwy\qfmlwy.tfl"

I received the following error: *'' is not a path to a .klc file! At C:\Users\ADMIN\Downloads\klctotfl.ps1:23 char:5

  • throw "'$klcFile' is not a path to a .klc file!"
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: ('' is not a path to a .klc file!:String) [], RuntimeEx ception
    • FullyQualifiedErrorId : '' is not a path to a .klc file!*

When I typed in what I thought would be the file path of the output folder of the TFL file, I got the same error. This is what I typed: "C:\Users\ADMIN\Desktop\Organization Folders\carpalx-msklc-0.11\MSKLC\qfmlwy"

How do I solve this error to make sure the KLC to TFL file converter script works?

0

There are 0 best solutions below