July 28, 2006 01:41
This is the first time I distribute an applescript application, so I'm not sure of how to do it properly.
In fact, this is not a simple applescript, It's an application build with Xcode, including a GUI and using applesript as language.
I think it's a stand alone app and should work out of the box normaly, but of course GPSNavX should be present. I don't think it should require any other dependencies. I did a test on a G5 ppc, and it works.
I've try another way to share the app
a zip folder : http://www.silex.net/clients/GPSRaceX.zip (20k)
a DMG : http://www.silex.net/clients/GPSRaceX.dmg (552k)
Maybe, just zipping the app may corrupt it.
For the code used :
Hoping this one works for you, regards
Christophe[/code]
GPSNavX Wrote:Would be far more beneficial if you just put the AppleScript source in a post.
In fact, this is not a simple applescript, It's an application build with Xcode, including a GUI and using applesript as language.
I think it's a stand alone app and should work out of the box normaly, but of course GPSNavX should be present. I don't think it should require any other dependencies. I did a test on a G5 ppc, and it works.
I've try another way to share the app
a zip folder : http://www.silex.net/clients/GPSRaceX.zip (20k)
a DMG : http://www.silex.net/clients/GPSRaceX.dmg (552k)
Maybe, just zipping the app may corrupt it.
For the code used :
Code:
(* ==== Properties ==== *)
property is_activated : false
property is_connected : false
property formated_lat : ""
property formated_lon : ""
property formated_cog : ""
property formated_sog : ""
(* ==== Event Handlers ==== *)
on clicked theObject
if name of theObject = "btn_start_gpsnavx" then
try
tell application "GPSNavX"
activate
set is_activated to true
try
tell first gps
if canConnect = true then
connect
set is_connected to true
end if
end tell
end try
end tell
end try
end if
end clicked
on idle theObject
if is_connected then
tell application "GPSNavX"
--activate
tell first gps
set formated_lat to latitude
set formated_lon to longitude
set formated_cog to cog
set formated_sog to sog
end tell
end tell
tell window "main" of theObject
set contents of text field "formated_latitude" to formated_lat
set contents of text field "formated_longitude" to formated_lon
set contents of text field "formated_course" to formated_cog
set contents of text field "formated_speed" to formated_sog
end tell
end if
-- We want to update the idle event every second, so we return 1
return 1
end idle
on should quit after last window closed theObject
return true
end should quit after last window closed
Hoping this one works for you, regards
Christophe[/code]