Apple Script?

For topics that don't fit under the other topics or forums.

Apple Script?

Postby mattias73 » Mon Aug 01, 2011 10:20 am

Hi there!

Somebody knows if Algodoo is apple script compatible? I would like to be able to scrip the start of a simulation...
mattias73
 
Posts: 9
Joined: Tue Jul 12, 2011 9:56 am

Re: Apple Script?

Postby Someone Else » Tue Aug 02, 2011 5:43 am

What do you mean by that?

If you open the console (~ or F10, previously F11)and type sim.running = true, hit Enter/Return, the sim will instantly start. Sim.running = false will stop it.
This is called Thyme and it's been in Phun since the very beginning.
I mean the beginning- it was in the first prototype version that was never released to the public, according to the changelog.

You could probably also use an external program to open Algodoo.

If, however, you want to use an external program to set sim.running = true, I think that will be close to impossible and would certainly void your warranty. "What warranty? I didn't know there was a---" "THERE IS NO WARRANTY!!!!!"
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Apple Script?

Postby Chronos » Tue Aug 02, 2011 6:14 am

Someone Else wrote:If, however, you want to use an external program to set sim.running = true, I think that will be close to impossible

Actually, it isn't really that hard to do, it just takes some programming know-how. (Which I don't have, actually, but I've seen it done before.)
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Apple Script?

Postby mattias73 » Wed Aug 03, 2011 12:37 pm

Someone Else wrote:What do you mean by that?



On an Apple computer there is something called apple script, making it possible to manipulate the starting/stopping etc of other programs from a written/recorded script.

So, I would like to write a script that eg starts algodoo and perhaps that then starts a simulation. The latter thing I think is possible only if the program (algodoo) is compatible with apple script.
mattias73
 
Posts: 9
Joined: Tue Jul 12, 2011 9:56 am

Re: Apple Script?

Postby Emanuel » Thu Aug 04, 2011 8:24 am

mattias73 wrote:
Someone Else wrote:What do you mean by that?



On an Apple computer there is something called apple script, making it possible to manipulate the starting/stopping etc of other programs from a written/recorded script.

So, I would like to write a script that eg starts algodoo and perhaps that then starts a simulation. The latter thing I think is possible only if the program (algodoo) is compatible with apple script.

Algodoo does not support being controlled with Apple Script, however Apple Script could probably be used to press spacebar which would start the simulation (a delay would be needed after starting Algodoo). To send spacebar:

Code: Select all
tell application "Algodoo"
   activate
   tell application "System Events" to key code 49
end tell


(I have not tried the script tho.)
It should even be possible to start with a specific scene.

/ Emanuel
Algodoo Developer
Emanuel
 
Posts: 293
Joined: Tue Feb 01, 2011 10:46 am
Location: Umeå, Sweden

Re: Apple Script?

Postby Split Circle » Sun Dec 04, 2011 1:02 am

...
Spoiler: show
Code: Select all
tell application "Algodoo"
   activate
   delay 10
   tell application "System Events"
      keystroke "`"
      delay 1
      keystroke "sim.running=true" --or your code
      keystroke return
      keystroke "`"
   end tell
end tell
Split Circle
 
Posts: 1
Joined: Tue Aug 16, 2011 8:04 pm


Return to Algodoo in general

Who is online

Users browsing this forum: No registered users and 1 guest

cron