Proxies in the Preferences

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
johnjohnston
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri May 13, 2011 3:37 pm
Contact:

Proxies in the Preferences

Post by johnjohnston » Fri Mar 08, 2013 10:21 am

Hi,
The Local Authority I work in (North Lanarkshire in Scotland) has just purchased LiveCode for use in our secondary schools.

We use a proxy to connect to the Internet.
This means we need to put the proxies into LiveCode's prefs on Mac OS, windows seems to get the system settings.

I've tried the following code in the terminal , and through Apple Remote Desktop to set the correct proxies:

Code: Select all

osascript -e 'tell application "LiveCode 5.5.3" to do script "set  the httpproxy to \"THE_FORUM_WONT_LET_ME_POST_LINKS\" "'
This works, but the proxies don't seem to 'stick' when LiveCode is relaunched.
They do seem to work if I manually open the prefs after setting via Apple Remote, but that rather defeats the purpose.

I've only made a couple of tests on a dozen or so macs, but would be grateful if someone could let me know if there is a way to do this.

Obviously using live Code 5.5.3, mac os 10.5 and 10.6 probably will be using 10.7 and 8 too.

cheers

John

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Proxies in the Preferences

Post by Klaus » Fri Mar 08, 2013 10:44 am

Hi John,

Livecode will read its preferences file on startup and set all these global properties,
but you did not set that pref, just the global property, which will be gone after LC quits.

The Livecode "preferences" is a stack (on my Mac) in:
specialfolderpath("preferences") & "/Runrev/livecode.rev"

I did not take a look yet, but this is surely a custom property in that stack :)


Best

Klaus

johnjohnston
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri May 13, 2011 3:37 pm
Contact:

Re: Proxies in the Preferences

Post by johnjohnston » Fri Mar 08, 2013 11:46 am

Thanks Klaus,

That did the trick, this AppleScript seems to work:

Code: Select all

tell application "LiveCode 5.5.3"
	activate
	do script "open  stack specialfolderpath(\"preferences\") & \"/Runrev/livecode.rev\""
	do script "set the cHTTPProxy of  this stack to \"PROXY_GOES_HERE\""
end tell
So I'll wrap that in a shell script for use in Apple Remote.

Code: Select all

osascript -e 'tell application "LiveCode 5.5.3"' -e 	'activate' -e 	'do script "open  stack specialfolderpath(\"preferences\") & \"/Runrev/livecode.rev\""' -e 	'do script "set the cHTTPProxy of  this stack to \"PROXY_GOES_HERE\""' -e 'quit' -e 'end tell'
Appreciate the lightning quick reply.

cheers

john

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Proxies in the Preferences

Post by Klaus » Fri Mar 08, 2013 1:08 pm

Hi John,

my pleasure :D

But you will also need to "save" and maybe also "close" that stack after setting the custom prop!
Otherwise this will also be "forgotten" after LC quits 8)


Best

Klaus

johnjohnston
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6
Joined: Fri May 13, 2011 3:37 pm
Contact:

Re: Proxies in the Preferences

Post by johnjohnston » Sat Mar 16, 2013 10:23 am

Klaus wrote: But you will also need to "save" and maybe also "close" that stack after setting the custom prop!
Otherwise this will also be "forgotten" after LC quits 8)
Ah, thanks again, too much SC and HC in my brain to think of saving!

cheers

john

Post Reply