So I'm working with database events now, and basically I want to ask the user for input so that that input can be put into a database field, however from what I can see, you are not allowed to get user input inside of a tell "Database Events".
How can I get around this?
Also, does anybody have a simple program to display the heirarchy of a database? So I can actually see if it's working or not? For the life of me I can't figure out how to display anything from a database (because of the "No User Action Allowed" thing).
Here is my code.
Honestly I don't know if any of this is working because I can't see the database....
But it will run whenever I take out this line...
When I try to run it with that line in it, I get this error...
Anybody know a way around it?
How can I get around this?
Also, does anybody have a simple program to display the heirarchy of a database? So I can actually see if it's working or not? For the life of me I can't figure out how to display anything from a database (because of the "No User Action Allowed" thing).
Here is my code.
Code:
(*Starting non-important variables*)
set loop1 to 0
set loop2 to 0
(*END OF VARIABLES*)
set theDBpath to POSIX path of "Macintosh HD:Users:#####:Desktop:Database:storedapps.dbev"
tell application "Database Events"
launch
open database theDBpath
tell database "storedapps"
set recordcount to (count records)
end tell
end tell
tell application "Finder"
set currentapps to the name of every process whose visible is true
end tell
tell application "Database Events"
tell database "storedapps"
repeat with loop1 from 1 to the length of currentapps
repeat with loop2 from 1 to recordcount
if item loop1 of currentapps = record loop2 then
display dialog "Found One"
else
make new record with properties {name:item loop1 of currentapps}
set usedfor to display dialog "What is this program used for?" default answer "Something Awesome"
tell record (item loop1 of currentapps)
make new field with properties {name:"Uses", value:usedfor}
end tell
end if
end repeat
end repeat
end tell
end tell
Honestly I don't know if any of this is working because I can't see the database....
Code:
set usedfor to display dialog "What is this program used for?" default answer "Something Awesome"
When I try to run it with that line in it, I get this error...
for the line specified directly above this.Database Events got an error: No user interaction allowed.
Anybody know a way around it?