Expected end of line but found identifier - applescript

So I was doing some coding duh and I made this
umm I didn't paste it because it was bugging out but yea the important part is this little thing
display dialog "Cya D: You should have played" buttons "Ok"
I know it seems super simple but it dosent work it says Expected end of line but found identifier. its so annoying and just saying it highlights Cya please help

AppleScript 2 no longer includes the Scripting Additions (which includes basic stuff like display dialog) if you have a use statement. You have to add:
use scripting additions
See: https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_control_statements.html#//apple_ref/doc/uid/TP40000983-CH6g-SW5

Try
{"OK"}
instead of
"OK"
buttons is usually followed by a list.

Related

How do I turn off "column box select" in visual studio code?

I seem to be unable to turn off box/column select. In other words, if I try to select across multiple lines, I only get a box select, as opposed to the usual behavior where entire lines are selected as I add lines.
I am using version 1.48.2 on a mac.
I must have pressed option+shift or some other such code inadvertently and now I can only select boxes. I have looked at my keyboard shortcuts but I don't know what to look for...
Unfortunately searching for solutions via google or SE only produces results for how to turn it on, not off! I don't know what the opposite mode is. "line select" seems to be just to select the current line, not for entire lines across multiline selections.
example of current behavior. I want the entire line "spaceship..." to be selected.
Just found the answer myself looking for something else. There is a "Text Editor" setting called "Editor: Column Selection" that controls this. The default is off, but I must have turned it on somehow without realizing it. Thanks to anyone who may have taken time to read this....
Cmd+8 is the shortcut to toggle the setting

how to show a dialog windows during applescript works

I wrote an applescript to convert a to b,
I want to show a dialog when script is working,
script first ask for a file and a folder from user, after this I want to show a dialog until my last dialog which say work is done.
I couldn’t find any help here or other sites regarding this way of implementing dialogs, thanks for you help.
to be clear, there is no way of having an input for steps, because it's doing a convert on one file only, but the file could be large & take some time, I'm looking for something that can input for example line of codes & progress depend on which line it's working right now or something else which start with the first line & close just before the end dialog

AppleScript - Speech to Text

I am trying to write a small AppleScript that can output a string of text which can be manipulated by another script. This works:
tell application "SpeechRecognitionServer"
set display to no
set theResponse to listen for {"yes", "no"}
if theResponse is "yes" then
display
else
say "Goodbye."
end if
end tell
The only problem is that it repeats the command that you issue it! (in our case, yes or no). So my question is: Is there a way to prevent it from repeating the command? I just do not see why it repeats the command, nor can I figure out which process runs the voice or I would just kill it.
Thanks
Manual fix:
System Preferences -> Speech -> Speech Recognition Tab
Disable the "Upon Recognition" checkbox.
Programatic fix:
This involves disabling these prefs before your code and then setting them back to their original values afterwards. That is, if you intend for this code to be portable to other users. If its only a personal script for yourself, then the manual fix is fine to set it permanently.
Refer to this forum for people asking the same question, and the various approaches they have tried:
http://macscripter.net/viewtopic.php?id=33259

Xcode 3.2 find and replace in selected text

Is it possible to find and replace in selected text in Snow Leopard Xcode 3.2? There always use to be an option for selected text. Really frustrating. Thanks.
Yeah, but it's a lot less obvious now. If you have the "Find" bar up, change the first dropdown menu to "Find & Replace". Then, if you hold option, the "Replace All" button turns into an "In Selection" button.
You can press Command+Ctrl+F to bring up directly the Find & Replace bar, and press Escape to remove it. I don't think there's anyway to activate the "Replace All" button using the keyboard, but then again there never was afaik.
In XCode 5 and earlier you can highlight a word and hit CMD+CTRL+E and then simply edit the word in line and it applies your edit to all occurrences of that word in the document.
Sometimes an image helps make things a little easier to grasp quickly. So this is to supplement the chosen answer.
And holding down Option:

Is it possible to disable command input in the toolbar search box?

In the Visual Studio toolbar, you can enter commands into the search box by prefixing them with a > symbol. Is there any way to disable this? I've never used the feature, and it's slightly annoying when trying to actually search for something that you know is prefixed by greater-than in the code. It's particularly annoying when you accidentally search for "> exit" and the IDE quits (I knew there was a line in the code that was something like if(counter > exitCount) so entered that search without thinking).
At the very least, can you escape the > symbol so that you can search for it? Prefixing with ^ doesn't seem to work.
This is a really cool feature. I've poked through the feature documentation, and the accompanying command list, and not a heck of a lot is showing up in terms of turning it off.
If you want to search for >exit, you could always type >Edit.Find >exit in the search box; that seems to do the trick. A bit verbose, though, but it really is an edge case.
you can enter commands into the search box by prefixing them with a > symbol.
Wow, I didn't know that. Where do I find the list of possible commands?
I never actually use the search box, I've remapped ctrl+F to incremental search, which is usually ctrl+I
I find this much cooler than the normal search - give it a go, you might end up not caring about the search box anymore.
Wow, I didn't know that. Where do I
find the list of possible commands?
The commands are the same as those you can enter in the command window, so you can pretty much drive the entire IDE and debugger using it. There are a load of predefined aliases for common commands. Open up the command window and enter alias for a list, to get you started.

Resources