Getting the Computers 'name' on a Mac and Windows
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Getting the Computers 'name' on a Mac and Windows
Is there a quick way to get the computers name on a mac and windows (and potentially linux) with rev?
I dont really want to go down the executing vbscript or applescrip t route as its just a small detail in an app im working on to sync a database between a few computers, and it would be neat to pre-fill the computer name in a form field as a suggestion for the user when they are initially setting up the sync.
I just wondered if there was a simply system style var in runrev that would give me access to this so I can pop it in the field when the card opens.
Thanks
Andy
I dont really want to go down the executing vbscript or applescrip t route as its just a small detail in an app im working on to sync a database between a few computers, and it would be neat to pre-fill the computer name in a form field as a suggestion for the user when they are initially setting up the sync.
I just wondered if there was a simply system style var in runrev that would give me access to this so I can pop it in the field when the card opens.
Thanks
Andy
Re: Getting the Computers 'name' on a Mac and Windows
Yep.
OSX (and possibly linux distros):
put shell("echo $HOSTNAME")
Windows:
put $COMPUTERNAME
OSX (and possibly linux distros):
put shell("echo $HOSTNAME")
Windows:
put $COMPUTERNAME
Re: Getting the Computers 'name' on a Mac and Windows
Thanks Mark,
I had tried put $COMPUTERNAME on my mac, I didnt think it might be different cross platform!
Ill use...
if the platform is "Win32" then
put $COMPUTERNAME into tComputerName
else
put shell("echo $HOSTNAME") into tComputerName
end if
That should work a treat!
Thanks again.
Andy
I had tried put $COMPUTERNAME on my mac, I didnt think it might be different cross platform!
Ill use...
if the platform is "Win32" then
put $COMPUTERNAME into tComputerName
else
put shell("echo $HOSTNAME") into tComputerName
end if
That should work a treat!
Thanks again.
Andy
Re: Getting the Computers 'name' on a Mac and Windows
Yeah - I tried viewing the $ environment variables with the message box (click on the fourth icon) but it didn't show anything useful, so I brought up a terminal window and typed "set" to see what was available.
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Getting the Computers 'name' on a Mac and Windows
On Mac you could just use 'the hostname' property in Rev. 'the hostname' may return the same value as $computername on Windows as well though I haven't tested.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Getting the Computers 'name' on a Mac and Windows
Trevor-
Good catch. Both the hostname and $COMPUTERNAME return the same value on Windows, although if it matters, hostname is in lowercase and for some reason $COMPUTERNAME is in uppercase.
Good catch. Both the hostname and $COMPUTERNAME return the same value on Windows, although if it matters, hostname is in lowercase and for some reason $COMPUTERNAME is in uppercase.
Re: Getting the Computers 'name' on a Mac and Windows
Trevor,
a bit off topic: today I searched for your wonderful enhancedQT external and eventually found it.
The link you currently have in your post to your developer resources
Thanks again for all the help and resources you provide
regards
Bernd
a bit off topic: today I searched for your wonderful enhancedQT external and eventually found it.
The link you currently have in your post to your developer resources
is broken.Releasable Revolution: Resources for Application Developers
Thanks again for all the help and resources you provide
regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Getting the Computers 'name' on a Mac and Windows
Thanks Bernd. It is back up now.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Getting the Computers 'name' on a Mac and Windows
Trevor,
sorry to bug you, but the link in your 'tag' is still broken.
So are the download links on
http://knowledgefaucet.com/developer/re ... cedqt.html
I was trying to direct someone to that link and did not notice that the download links are broken.
It would be a pitty if people could not reach your wonderful resources for Revolution.
Thank you
regards
Bernd
sorry to bug you, but the link in your 'tag' is still broken.
So are the download links on
http://knowledgefaucet.com/developer/re ... cedqt.html
I was trying to direct someone to that link and did not notice that the download links are broken.
It would be a pitty if people could not reach your wonderful resources for Revolution.
Thank you
regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Getting the Computers 'name' on a Mac and Windows
I just tested the link in my signature and it works fine. The link you posted is not the actual site. That looks like an old version of the site from some time ago.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Getting the Computers 'name' on a Mac and Windows
Trevor,
thanks, after emptying the cache of my browser the link works. Sorry about that.
Now your resources are easy to find.
regards
Bernd
thanks, after emptying the cache of my browser the link works. Sorry about that.
Now your resources are easy to find.
regards
Bernd