• Welcome to MacSailing.net!
  • Dedicated to sailing!
  • Be Jolly!
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Title: Applescript
#8
This is the first time I distribute an applescript application, so I'm not sure of how to do it properly.

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]
 
Reply
  


Messages In This Thread
Applescript - by - July 26, 2006 10:09
[No subject] - by - July 26, 2006 10:32
[No subject] - by - July 27, 2006 02:09
[No subject] - by - July 27, 2006 08:43
[No subject] - by - July 27, 2006 09:10
Re: Applescript - by - July 27, 2006 13:14
[No subject] - by - July 27, 2006 17:20
[No subject] - by - July 28, 2006 01:41

Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking for a MacENC Developer AppleScript Contractor for Hourly Work neep3r 1 3,909 November 3, 2018 13:33
Last Post: samuelbrecher93
  Applescript and macENC Russell 1 2,850 January 6, 2018 11:09
Last Post: Jade
  Applescript and MacENC Eric Frank 4 3,771 September 1, 2012 22:16
Last Post: mrfugu

Forum Jump:


Browsing: 1 Guest(s)