Controlling Hardware
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Controlling Hardware
Hi guys.. I'm using revolution to build a kiosk. I'd like to build in functionality to where it will communicate back to a central server via http so that we can control these kiosks in various stores. Specifically, I'm wondering if you can do the following in revolution on a Mac.
1. Reboot the machine
2. Determine running applications/processes
Thanks,
Justin
1. Reboot the machine
2. Determine running applications/processes
Thanks,
Justin
Re: Controlling Hardware
Hi Justin,
you can do that via applescript
you can run this in the script editor (applescript)
in Rev you can put the applescript into a field e.g. named "fAllProcesses" and than
for restart the same
regards
Bernd
Edit: forgot to remove a trailing linefeed. You might want to put into above code instead of the original line.
B.
you can do that via applescript
Code: Select all
tell application "System Events"
set tAllProcesses to ""
set tProcessItems to the name of every process
repeat with anItem in tProcessItems
set tAllProcesses to (tAllProcesses & anItem as text) & linefeed
end repeat
return tAllProcesses
end tell
Code: Select all
tell application "System Events"
restart
end tell
in Rev you can put the applescript into a field e.g. named "fAllProcesses" and than
Code: Select all
on mouseUp
put field "fAllProcesses" into tAllProcessesThatRun
do tAllProcessesThatRun as applescript
put the result into tAllTheRunningStuff
put char 2 to -2 of tAllTheRunningStuff into tAllTheRunningStuff -- remove quotes
put tAllTheRunningStuff
end mouseUp
regards
Bernd
Edit: forgot to remove a trailing linefeed. You might want to put
Code: Select all
put char 2 to -3 of tAllTheRunningStuff into tAllTheRunningStuff -- remove quotes & trailing linefeed
B.
Re: Controlling Hardware
Thanks Bernd. I'll give this a try today. Can you have a Revolution app with fields but no visible cards? I'm thinking now I'll just build this as a "service" type app that runs in the background on the machine.
Re: Controlling Hardware
Justin,
you dont have to put the applescript into a field. You might just as well put it into a custom property. Or you might construct in a script on the fly. The reason it is in a field is that for me that is the easiest way to look at it, debug/replace it. Once the script works you might try the other options: (though I dont like constructing the aplescript on the fly because of all the quoting needed, it makes it error prone for me)
Without knowing what you want to do with your app in the background: shure you can hide the stack after startup. Probably in a opencard script of the first and only card you could say:
regards
Bernd
you dont have to put the applescript into a field. You might just as well put it into a custom property. Or you might construct in a script on the fly. The reason it is in a field is that for me that is the easiest way to look at it, debug/replace it. Once the script works you might try the other options: (though I dont like constructing the aplescript on the fly because of all the quoting needed, it makes it error prone for me)
Without knowing what you want to do with your app in the background: shure you can hide the stack after startup. Probably in a opencard script of the first and only card you could say:
Code: Select all
on opencard
send "hideThisStack" to me in 1 second -- adjust
end opencard
on hideThisStack
set the visible of this stack to false
end hideThisStack
Bernd
Re: Controlling Hardware
Bernd,
Thanks again for the reply.. don't think I stated my question clearly enough. What I meant was can I run a Rev app as a service where it doesn't show up if the user does cmd + tab, doesn't have a menu, etc. That may be more of an Apple question than a revolution question, but I thought I'd check. Basically, I want this app to start when the machine starts but be running in the background.
Thanks again for the reply.. don't think I stated my question clearly enough. What I meant was can I run a Rev app as a service where it doesn't show up if the user does cmd + tab, doesn't have a menu, etc. That may be more of an Apple question than a revolution question, but I thought I'd check. Basically, I want this app to start when the machine starts but be running in the background.
Re: Controlling Hardware
Justin,
regards
Bernd
I don't think so. But someone else might know more about this.jwbuzz wrote:can I run a Rev app as a service where it doesn't show up if the user does cmd + tab, doesn't have a menu, etc.
regards
Bernd
Re: Controlling Hardware
See LSUIElement if your application should not appear in the Dock or in the Force Quit window.jwbuzz wrote:Thanks Bernd. I'll give this a try today. Can you have a Revolution app with fields but no visible cards? I'm thinking now I'll just build this as a "service" type app that runs in the background on the machine.
You could also add- and remove login items by AppleScript.
Robert