AppleScript issue
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
AppleScript issue
Re: AppleScript, where “tScript” is my script:
Does SuperCard
get script(do,tScript,AppleScript)
=
LiveCard:
do tScript as “AppleScript”
??
{ doesn’t seem to, but neither platform returns errors}
Does SuperCard
get script(do,tScript,AppleScript)
=
LiveCard:
do tScript as “AppleScript”
??
{ doesn’t seem to, but neither platform returns errors}
Re: AppleScript issue
It has been a very long time, HC ages ago, that I executed as script as AppleScript.
I tried the LC dictionary example:
and got at execution error. A simple line of LC code run "as AppleScript" gave the same error.
I am not much help.
Craig
I tried the LC dictionary example:
Code: Select all
do "result = 1 + 1" as "vbscript"
answer the result
I am not much help.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: AppleScript issue
@mcelvain: Yes, those two examples should be roughly equivalent. Did the LC script not work?
@dunbarx: Do you have VB Script installed on your machine? Does the same script work outside of LC?
@dunbarx: Do you have VB Script installed on your machine? Does the same script work outside of LC?
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
Re: AppleScript issue
Thank-you, Craig.
Is it possible for LC to pass Terminal commands ?
Is it possible for LC to pass Terminal commands ?
-
- Posts: 101
- Joined: Mon Jan 03, 2022 7:10 pm
Re: AppleScript issue
Look up "shell" in the dictionary, that will allow you to run terminal commands
Re: AppleScript issue
no VB Script on this machine, which is a Mac.
Thank-you for recommending beginning with the dictionary "shell" definition/explanation.
One additional question which I should probably post as a new query: How do I enlarge the script editor text which loads in the variable window upon clicking a specific variable ?
This window is a terrific tool, which also stays open through multiple handler calls.
I cannot find a solution for resizing this text in preferences.
Thank-you !
Thank-you for recommending beginning with the dictionary "shell" definition/explanation.
One additional question which I should probably post as a new query: How do I enlarge the script editor text which loads in the variable window upon clicking a specific variable ?
This window is a terrific tool, which also stays open through multiple handler calls.
I cannot find a solution for resizing this text in preferences.
Thank-you !
Re: AppleScript issue
Hi.
The preferences pane offers the textSize right near the top. You will find it.
Interestingly, this did not work:
and I have hacked this stack now and then,
Field 1 is the default field if only one object's script is being examined. If you add others, they are field 2, 3, etc.
I have colored groups of lines in the SE, treating it just like any ordinary stack, which it pretty much is. I do this all the time so I can scroll through an entire script and find my way back to certain regions quickly. I am not sure why the above code does not work. I will check when I get to my office tomorrow, and see why I can change the backColor of, say, line 200 - 300, but not chase the text size here on my laptop.
Craig
The preferences pane offers the textSize right near the top. You will find it.
Interestingly, this did not work:
Code: Select all
set the textsize of fld 1 of stack "revNewScriptEditor" to 18
Field 1 is the default field if only one object's script is being examined. If you add others, they are field 2, 3, etc.
I have colored groups of lines in the SE, treating it just like any ordinary stack, which it pretty much is. I do this all the time so I can scroll through an entire script and find my way back to certain regions quickly. I am not sure why the above code does not work. I will check when I get to my office tomorrow, and see why I can change the backColor of, say, line 200 - 300, but not chase the text size here on my laptop.
Craig
Re: AppleScript issue
stack "revNewScriptEditor" is probably the template stack, from which each instance of the SE is generated.
It probably needs to be referred to as "revNewScriptEditor 1" (or subsequent index number if you have opened more than one SE instance).
It probably needs to be referred to as "revNewScriptEditor 1" (or subsequent index number if you have opened more than one SE instance).
Re: AppleScript issue
Sparkout.
I am sure you are correct, as I have always used "revnewScriptEditor 1".
But I got an error trying it, so I lost the "1".
I wonder if I typed "revnewScriptEditor1". I would not put that past me.
Craig
I am sure you are correct, as I have always used "revnewScriptEditor 1".
But I got an error trying it, so I lost the "1".
I wonder if I typed "revnewScriptEditor1". I would not put that past me.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: AppleScript issue
The script editor may have multiple windows. You could use "the windows" function to find the topmost one beginning with "revScriptEditor", but perhaps easier is a plugin script that triggers on launch to set the values right in the master Script Editor.
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
-
- Livecode Opensource Backer
- Posts: 10097
- Joined: Fri Feb 19, 2010 10:17 am
Re: AppleScript issue
Indeed it may . . .The script editor may have multiple windows.
- -
BUT, I think that this . . .
- -
Where the scriptEditor allows 2 views of the same script would be fantastic.
Re: AppleScript issue
If you mean the the window that pops up when in the Debugger you click on a variable then that window is a stack called "revVariableVisualizer 1" with an increasing numbering when invoked repeatedly.mcelvain wrote: ↑Sun May 21, 2023 6:39 amOne additional question which I should probably post as a new query: How do I enlarge the script editor text which loads in the variable window upon clicking a specific variable ?
This window is a terrific tool, which also stays open through multiple handler calls.
I cannot find a solution for resizing this text in preferences.
That stack is created on the fly by stack "revSEVariablesPaneBehavior" in handler "private on nodeCreateVisualizationObject" beginning at line 298 in LC 9.6.9.
To change the textSize of the field "Value" of said stack you could add a line (marked --< added)
Code: Select all
private on nodeCreateVisualizationObject pPathToNode
add 1 to sVisualizationObjectCount
local tOldLock
put the lockMessages into tOldLock
lock messages
local tStack
reset the templateStack
set the _ideoverride of the templateStack to true
set the width of templateStack to 270
set the height of templateStack to 250
create invisible stack "revVariableVisualizer " & sVisualizationObjectCount
put the long id of it into tStack
set the behavior of tStack to the long id of stack revIDEScriptEditorBehavior("variable visualizer")
set the cMutable of tStack to true
set the destroyStack of tStack to true
set the destroyWindow of tStack to true
set the title of tStack to "Value : " & friendlyNodeReference(pPathToNode)
revMetadataSet the name of stack tStack, "general", "visualizer", true
-- generate variable visualizer UI
local tOldDefaultStack
put the defaultStack into tOldDefaultStack
set the defaultStack to the short name of tStack
reset the templateButton
set the height of the templateButton to 23
create button "Apply"
reset the templateField
set the vScrollbar of the templateField to true
set the textSize of the templateField to 16 --< added
create field "Value"
-- more code
As far as I know there is no way to set a preference for this.
To make it easy I append a stack that patches stack "revSEVariablesPaneBehavior" with the modification.
That patch stack is tested using LC 9.6.9 and it works. Since very little has changed in the debugging part of LC recently it should work at least with the LC 9.x.x series (not tested).
The changes the patch applies are temporary and are gone when you quit LC. You would have to run it again when starting LC.
Kind regards
Bernd
Click on the button e.g. after starting LC
- Attachments
-
- Increase textSize of VariableWatcher.livecode.zip
- (2.51 KiB) Downloaded 151 times
Re: AppleScript issue
If you want to use above stack in versions of LC <= 9.6.5 you have to open the Script Editor once before applying the patch. Tested as far back as 9.0.0.bn wrote: ↑Tue May 23, 2023 10:24 amTo make it easy I append a stack that patches stack "revSEVariablesPaneBehavior" with the modification.
That patch stack is tested using LC 9.6.9 and it works. Since very little has changed in the debugging part of LC recently it should work at least with the LC 9.x.x series (not tested).
Starting LC 9.6.6 you do not have to start the Script Editor first. Tested including LC 10.0.0 DP5.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: AppleScript issue
Historically, having an easy way to render all script-related text consistently is what the scriptTextFont and scriptTextSize were for, from HyperCard though SuperCard and MetaCard.
https://quality.livecode.com/show_bug.cgi?id=11596
https://quality.livecode.com/show_bug.cgi?id=11596
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
-
- Livecode Opensource Backer
- Posts: 10097
- Joined: Fri Feb 19, 2010 10:17 am
Re: AppleScript issue
"LiveCode QCC 2013-12-16 12:30:00 EST
Hi Richard,
thank you for logging this report, we are currently reviewing it.
We will update you when the status changes or information in the report is updated.
Kind Regards,"
my emphasis.
About 11 and a half years ago
Hi Richard,
thank you for logging this report, we are currently reviewing it.
We will update you when the status changes or information in the report is updated.
Kind Regards,"
my emphasis.
About 11 and a half years ago