JSFiddle - React, Tailwind, and code Playground
by huppen
HTML
//domain-chooser
JavaScript
//domain-chooser
set domainList to {}
set pwList to {}
try
--server directory
set Kunden to paragraphs of (read POSIX file "/Volumes/Hosting/kunden_hosting.txt" as «class utf8»)
set Server to "iServer"
on error
display dialog "/Volumes/Hosting/kunden_hosting.txt ist nicht verfügbar" with title "Server Pfad nicht verfügbar!" buttons {"Abbrechen", "Lokal versuchen"}
try
set theHome to POSIX path of (path to home folder from user domain)
set localpath to the text returned of (display dialog "Wo liegt die Datei lokal?" default answer "" & theHome & "Library/Services/kunden_hosting.txt")
set Kunden to paragraphs of (read POSIX file localpath as «class utf8»)
set Server to "Lokal"
on error
display dialog "Fehler bei lokaler Datei, bitte den Pfad prüfen." with title "Datei ist Lokal nicht verfügbar oder der Pfad ist falsch!" buttons "OK"
return false
error number -1700
end try
--return false
--error number -1700
end try
repeat with nextLine in Kunden
if length of nextLine is greater than 0 then
--split by pipe |
set AppleScript's text item delimiters to "|"
--create two lists name and mail
set {tmpDomain, tmpPw} to {text item 1 of nextLine, text item 2 of nextLine}
copy tmpDomain to the end of domainList
copy tmpPw to the end of pwList
set AppleScript's text item delimiters to ""
end if
end repeat
set domain to (choose from list domainList with prompt "Kunden Domains @ " & Server & ":" with title "Bitte eine Domain auswählen!" OK button name "OK" cancel button name "Abbrechen")
if domain is {false} or domain is false then
error number -128
end if
on list_position(this_item, this_list)
repeat with i from 1 to the count of this_list
if item i of this_list is this_item then return i
end repeat
return 0
end list_position
set the pw to ¬
item (list_position((domain as string), domainList)) of the pwList
--input function
to inputByName(theName, num, theValue)
tell application "Google Chrome" to tell active tab of window...