• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get Windows languages and put them inside DropDownList

Enthusiast ,
May 31, 2022 May 31, 2022

Copy link to clipboard

Copied

Get Windows languages and put them inside DropDownList And when writing inside the text box.. it is

Untitled-1.jpg

written in the language that was chosen from the list

002.jpg

 

 

001.jpg

TOPICS
Actions and scripting , SDK , Windows

Views

164

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Aug 13, 2022 Aug 13, 2022

Copy link to clipboard

Copied

This cannot be done from jsx inside Photoshop, but is most likely possible using operating system tools.
For example, you can get the list of keyboard languages with a VBS script (your script should create a VBS file with this code, run it, read the result from a text file), but getting the active keyboard layout and switching the language with VBS is tricky.
Perhaps this can be done through powerShell, but I practically do not use it and cannot say for sure.

 

 

Option Explicit
Dim WshShell:Set WshShell = CreateObject("WScript.Shell")
Dim Preloaded(), Layout, n, strLog: strLog = "Keyboard_Layouts.log"
On Error Resume Next
Do
n = n + 1
Layout = WshShell.RegRead("HKCU\Keyboard Layout\Preload\" & n)
        If Err.Number = 0 Then
            ReDim Preserve Preloaded(n - 1)
            Preloaded(n - 1) = Layout
        Else
            Exit Do
        End If
    Loop
    On Error GoTo 0
    Dim LangFullName(): ReDim LangFullName(UBound(Preloaded))
    Dim LangShortName(): ReDim LangShortName(UBound(Preloaded))
    For n = 0 To UBound(Preloaded)
        LangFullName(n) = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\" & Preloaded(n) & "\Layout Text")
        LangShortName(n) = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout\DosKeybCodes\" & Preloaded(n))
    Next
    Set WshShell = Nothing
    If UBound(preloaded) > 0 Then
            Dim objFS: Set objFS = CreateObject("Scripting.FileSystemObject")
            strLog = objFS.BuildPath(objFS.GetParentFolderName(WScript.ScriptFullName), strLog)
            Dim objFile: Set objFile = objFS.CreateTextFile(strLog, True)
            Dim i
    For i = 0 To UBound(preloaded)
        objFile.Write LangFullName(i) + " (" + LangShortName(i) + ")" + vbCrLf
    Next
            objFile.Close
            Set objFile = Nothing
            Set objFS = Nothing
        End If

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 13, 2022 Aug 13, 2022

Copy link to clipboard

Copied

thanks for helping me
Can I convert this code to jsx?
To work in Photoshop or not?
This language is vb.net or visual.net as far as I know

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

LATEST

 

I came up with this code which is vb.net code
Is there a way to read this code in javascript?

 

 Private Inputlang As New InputLanguages
    Private ArabicInput As InputLanguage
    Private EnglishInput As InputLanguage

Sub Changelang(txtcontrol As TextBox, cmbcontrol As ComboBox)
        If cmbcontrol.SelectedIndex = 0 Then
            Inputlang.ArabicKeyboard()
            'InputLanguage.CurrentInputLanguage = ArabicInput
            txtcontrol.RightToLeft = Windows.Forms.RightToLeft.Yes
        ElseIf cmbcontrol.SelectedIndex = 1 Then
            Inputlang.EnglishKeyboard()
            'InputLanguage.CurrentInputLanguage = EnglishInput
            txtcontrol.RightToLeft = Windows.Forms.RightToLeft.No
        End If
    End Sub


Private Sub USERNAME_Enter(sender As Object, e As EventArgs) Handles USERNAME.Enter
        Changelang(USERNAME, ComboBox1)
    End Sub


 Private Sub USERNAME_KeyDown(sender As Object, e As KeyEventArgs) Handles USERNAME.KeyDown
        Changelang(USERNAME, ComboBox1)
    End Sub

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines