altering scripts by a script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
altering scripts by a script
I need to alter many scripts (isoTomac thing) when a stack is opened in windows but the stack is password protected. I can remove the protection in the script, perform the alterations, and relock the stack. However, the docs say that the relocking won't take effect until the stack is closed and reopened.
The stacks are served over the internet via the load command, used "once", and when closed, the user can't reopen the now altered stack.
Any ideas around this?
The stacks are served over the internet via the load command, used "once", and when closed, the user can't reopen the now altered stack.
Any ideas around this?
Hi Wally,
This is not necessary. Apparently, you are doing something wrong. Could you please explain why exactly you believe you need to do this?
Stacks stay unlocked until they are closed and there is no way around that.
Also, you need a Revolution license to change a script that is larger than 10 linces. A player or standalone without a license can't do this.
Best,
Mark
This is not necessary. Apparently, you are doing something wrong. Could you please explain why exactly you believe you need to do this?
Stacks stay unlocked until they are closed and there is no way around that.
Also, you need a Revolution license to change a script that is larger than 10 linces. A player or standalone without a license can't do this.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
I write the stacks on a Mac and they use a special science font I created called Chemistry. I have to change the scripts when they are opened in Windows(using isoTomac) because the scripts use characters in the upper ASCII range. Without the isoTomac translation, the stacks are worthless on Windows.
I have a fair number of stacks to "worry" about so I wish there was a way around this. I don't want to have to create and serve Windows versions and Mac versions as this would be a nightmare to keep track of.
Since you say there is no way around this I guess the stacks will have to remain unlocked after the translation? The translation works flawlessly, I just can't relock the stack.
As I said, I will have a fair number of stacks to "worry" about so I wish there was a way around this.
The license is not an issue, I have an Enterprise license.
As an aside, how to you think things like this will work with the new Web Plug In that's coming in the fall?
I have a fair number of stacks to "worry" about so I wish there was a way around this. I don't want to have to create and serve Windows versions and Mac versions as this would be a nightmare to keep track of.
Since you say there is no way around this I guess the stacks will have to remain unlocked after the translation? The translation works flawlessly, I just can't relock the stack.
As I said, I will have a fair number of stacks to "worry" about so I wish there was a way around this.
The license is not an issue, I have an Enterprise license.
As an aside, how to you think things like this will work with the new Web Plug In that's coming in the fall?
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
You may find it more flexible in the long run to move data out of scripts, using custom properties or fields instead. That way you can add or modify the strings at any time without having to much around in the scripts at all.
As for the web plugin, it'll be useful for those who have a need to deliver their stacks specifically inside of a browser window. For my own customers, I've found that anyplace that will entertain the notion of installing a new plugin will be just as quick to install a standalone application. Since Rev standalones already have good HTTP support, transferring stacks over web protocols from a server to a standalone is convenient and can be done today, as you've found.
As for the web plugin, it'll be useful for those who have a need to deliver their stacks specifically inside of a browser window. For my own customers, I've found that anyplace that will entertain the notion of installing a new plugin will be just as quick to install a standalone application. Since Rev standalones already have good HTTP support, transferring stacks over web protocols from a server to a standalone is convenient and can be done today, as you've found.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Hi Wally,
As far as I know, scripts are already being translated by an equivalent of the isoToMac/macToIso functions when a stack is opened on a diferent platform. So, I really wonder what is going on here. You should not have to translate your scripts. Can you give a brief example of a script that needs to be translated for cross-platform compatibility?
As Richard says, keeping strings and data in properties might be a possibility. If you keep strings in fields, they are automatically translated too.
Are you just using upper ASCII, or are you actually using a different encoding, e.g. a unicode encoding?
Best,
Mark
As far as I know, scripts are already being translated by an equivalent of the isoToMac/macToIso functions when a stack is opened on a diferent platform. So, I really wonder what is going on here. You should not have to translate your scripts. Can you give a brief example of a script that needs to be translated for cross-platform compatibility?
As Richard says, keeping strings and data in properties might be a possibility. If you keep strings in fields, they are automatically translated too.
Are you just using upper ASCII, or are you actually using a different encoding, e.g. a unicode encoding?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thanks for the suggestions, gentlemen. Remember, I said earlier that I "built" the chemistry font and apparently I didn't do it exactly right. For me, cross platform fonts are amazingly complex and I didn't spend the necessary time to become wise enough to create the font to work exactly as you have said it should.
I'm going with a Plan "B." Currently, I've set the script editor to the chemistry font and then type the special characters directly into the scripts. For plan "B," I'll set the script editor font to any font and use the numTochar function in the scripts to put the chars into flds that have Chemistry selected as its font. I used Mark's ASCII utility stack and the the ASCII values of the Windows and Mac versions of my font all match. Sound like a good plan?
I'm going with a Plan "B." Currently, I've set the script editor to the chemistry font and then type the special characters directly into the scripts. For plan "B," I'll set the script editor font to any font and use the numTochar function in the scripts to put the chars into flds that have Chemistry selected as its font. I used Mark's ASCII utility stack and the the ASCII values of the Windows and Mac versions of my font all match. Sound like a good plan?