I have two questions...
Here is a really simple example script which causes an error:
System Events got an error: Can’t make item 1 of every application process whose visible = true into type string.
tell application "System Events"
repeat with appProc in (every application process whose visible is true)
display dialog appProc
end repeat
end tell
This would be helpful for future reference so I can figure out what kind of data type I am dealing with
I tried adding:
appProc as string
but then I get another error that says:
Can’t make «class pcap» "myapplication" of application "System Events" into type string.
To get the data type... use class...
set a to "some text variable"
return class of a
Convert to string?... try "as text" or "as string". It mostly works. However in your case appProc has properties (as Red_menace mentioned) and you want to display its name property...
display dialog (name of appProc)