Skip to content

Instantly share code, notes, and snippets.

@diamantidis
Last active July 5, 2020 15:24
Show Gist options
  • Save diamantidis/09e96144efb1f9c5ad06c0722b9ab893 to your computer and use it in GitHub Desktop.
Save diamantidis/09e96144efb1f9c5ad06c0722b9ab893 to your computer and use it in GitHub Desktop.
activate application "SF Symbols"
tell application "System Events"
tell process "SF Symbols"
-- Click the “list” radio button.
click radio button 2 of radio group 1 of group 3 of toolbar 1 of window 0
tell outline 1 of scroll area 1 of splitter group 1 of window 0
select (row 1 where value of static text 1 of UI element 1 starts with "All")
end tell
set enumCases to ""
repeat with sfSymbolRow in rows of table 1 of scroll area 1 of group 1 of splitter group 1 of window 0
set sfSymbolName to value of static text 1 of UI element 2 of sfSymbolRow
set caseIdentifier to my toCamelCase(my handleNameRestrictions(sfSymbolName))
set enumCases to enumCases & " case " & caseIdentifier & " = \"" & sfSymbolName & "\"
"
end repeat
set startOfEnum to "public enum SFSymbol: String, CaseIterable {
"
set endOfEnum to "}"
set enum to startOfEnum & enumCases & endOfEnum
set the clipboard to {text:(enum as string), Unicode text:enum}
enum
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment