Topic: https://brettterpstra.com/2010/10/02/homecontrol-local-mac-control-for-iphone/
hide preview

What's next? verify your email address for reply notifications!

Mary 13y, 289d ago

Hello there, just wandered by doing some research for a cell phone to home phone blog post. Truly more information that you can imagine on the web. Wasn't exactly what I was looking for, but cool site. Have a great day.

hide preview

What's next? verify your email address for reply notifications!

Natan 14y, 128d ago

For anyone who wants it, you can add these two lines:

exec("osascript -e 'tell application &#092"System Events&#092" to set visible of process &#092"$app&#092" to true'");
exec("osascript -e 'tell application &#092"System Events&#092" to set frontmost of process &#092"$app&#092" to true'");

to

function startapp($app) {
exec("osascript -e 'tell application &#092"$app&#092" to launch'",$response);
if (isrunning($app) == "1")
return "$app launched";
else
return "Error launching $app";
}

between return "Error launching $app"; and the bracket to make the application you launch come to the front.
(it's in functions.php)

remark link
hide preview

What's next? verify your email address for reply notifications!

Brendy 13y, 313d ago

Kewl you should come up with that. Ecxenllet!

hide preview

What's next? verify your email address for reply notifications!

Natan 14y, 128d ago

Oh yeah, forgot to mention what it does -
when you launch an application, it will set it's visible and frontmost to true. Or, in other words, when you launch an application, it will come up in front of all your other open applications.

hide preview

What's next? verify your email address for reply notifications!

Natan 14y, 129d ago

I wrote a script to generate HTML for the application launcher. It isn't great, but it works.
See it at: https://github.com/kuyanata...
Just for anyone who might be able to use it.

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 129d ago

Cool! My only concern would be that when you load the page from your server, by default it checks every process in the list to determine if it's running. Because it's doing that with AppleScript, the thread/memory control is pretty bad and a long list could probably hang the server… I haven't tried it, though… how long a list have you been able to load?

It wouldn't be too difficult to remove the check for initial state and just check an app when it's requested. For example, don't have the switch show up when the page loads, tap the app name to check it's state, then get the switch set to the correct on/off state for toggling. That would circumvent the whole issue, and you could run your entire Apps folder out of it.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Natan 14y, 128d ago

I've been able to load a list of about 54 applications. There /is/ a bit of lag when I go to the page, but not that much.
I agree with your solution. As an alternative. you could remove the switches and just have a button that performs the same function.

Oh, and I found out if an application's name takes up too much space, then the on/off switches will be pushed down, pushing some of the switches below it with it.

hide preview

What's next? verify your email address for reply notifications!

max 14y, 158d ago

Hi,
I installed the homecontrol scripts on my webserver and the page loads fine. the first time I went to the application section it figured out that sendtome was started but did not recognize itunes running. since then it does not recognise any app being launched . whenever i turn any app on, it says "error loading itunes" on the info bar.

i have got php5 installed.

any idea?

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 157d ago

Are the other functions working for you? System Volume, iTunes control, etc.?

remark link parent
hide preview

What's next? verify your email address for reply notifications!

max 14y, 157d ago

no, none of the functions are working.... :(

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Christopher 14y, 145d ago

I've been tinkering with AppleScript, and I love what you're doing here. Thing is, I'm having the same problems as Max above. Any help would be greatly appreciated.

remark link parent

load more (1 remarks)
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 145d ago

I haven't had much time to do "support" on this project, but I'll try to get back to you both with some suggestions as soon as I'm able.

hide preview

What's next? verify your email address for reply notifications!

Hunter 14y, 158d ago

I'm getting the same thing as Jeff!

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 158d ago

I just got a screenshot from Jeff, and it appears to be a permissions problem with writing the volume out to a text file, at least in part. In Terminal, change to the folder where homecontrol lives (cd ~/Sites/homecontrol) and then type

touch volume.txt; chmod 777 volume.txt

See if that helps, and let me know.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Hunter 14y, 156d ago

Still doesn't work. Every time I use "volume up" it says volume 10 no matter how many times; volume down yields -10 every time. mute doesn't seem to do anything. itunes still doesn't respond to anything. no more error messages though!

hide preview

What's next? verify your email address for reply notifications!

Jeff 14y, 158d ago

I cannot seem to get the web app working. Every time a function is called, I get errors regarding a parameter needing to be a resource, but given as a boolean. This is true of the volume commands and app launching commands. The iTunes commands don't seem to do much of anything. I have my personal web server up and running with PHP5 installed. Any ideas?

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 158d ago

Are you running the stock Snow Leopard PHP5, or a custom build? I'll email you directly and see if I can get a screenshot of the error message so I'm sure I know what you're seeing.

hide preview

What's next? verify your email address for reply notifications!

zen 14y, 159d ago

hi guys, is it possible to control the "apple's special keys" (like volume +/- or brightness +/-) with this app?
i haven't found any program that can actually do this :(

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 159d ago

It can control anything AppleScript can control, and volume is easy. Brightness would require some System Event scripting, like this.

hide preview

What's next? verify your email address for reply notifications!

Hunter 14y, 159d ago

I'm getting all sorts of errors when I try to use it. Everything shows up, but when I push buttons, I get script errors at the top of the screen and nothing happens. What have I done wrong?

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 159d ago

Did you make sure php was enabled? Most of those errors are usually raw php that isn't being processed by the server.

hide preview

What's next? verify your email address for reply notifications!

John Watson 14y, 162d ago

It looks like you may be missing a few images from the zip file. I'm getting a few 404's while things are running. I'm adding support for toggling Airfoil speakers. Let me know if you're interested in my (very hacky) code!

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 161d ago

I'll take a look at the zip and see what's up. I'd definitely love to see what you do with the Airfoil toggle. Feel free to contact me with an update!

hide preview

What's next? verify your email address for reply notifications!

Anville 14y, 168d ago

Wow, this looks very cool! I have just been on a parallel path the last week or so, actually, and came up with this : http://code.google.com/p/bu...

Your web development skills are much better then mine, I see :-)

I also started off with PHP and apache, but moved over to using Python and the Tornado web server package (http://www.tornadoweb.org/). Using Platypus ( http://www.sveinbjorn.org/p..., I was able to make a user launchable web-server app with custom password and port.

Can't wait to look at your stuff this evening!

remark link
hide preview

What's next? verify your email address for reply notifications!

btadmin 14y, 167d ago

That's actually a really awesome solution to the web server security issue. Looking forward to digging into your code, too!

hide preview

What's next? verify your email address for reply notifications!

justinxreese 14y, 168d ago

Wow! You turned my silly little script into a highly functioning application. Cool

hide preview

What's next? verify your email address for reply notifications!