Script editor does not open in Spark AR Studio - facebook

I have installed Spark AR Studio on Windows. I was able to work with basic effects. However when I tried to create a Script asset and open it up, it keeps failing with the error code 800A03EA. Source is shown as Microsoft JScript compilation error. I can see the file using Notepad and it only has two line in there.
// How to load in modules
const Diagnostics = require('Diagnostics');
const Scene = require('Scene');

SparkAR Studio tries opening your scripts with the default editor assigned to .js files on your operating system.
Assign Visual Studio Code / Sublime / etc. to be your standard way of opening .js files on Windows and SparkAR will open it when you click on it

To set default editor for Js files you can just create empty js file - right click on it - choose default program to open and go to your favourite editor (sublime, vscode, etc). That's all

Set Atom/VS code/Sublime as your default JS editor.

Right click on the script.js file and a menu window will open. Click on 'Reveal in Explorer' and it will take you to the location. There, right click on the script.js file and open it with any other editor (e.g. Atom).

Related

Visual studio code - how to open multiple windows from context option

There are some guides in stackoverflow for opening multiple windows in Visual Studio. But it is inside the Visual Studio they are talking about.
Here is what I want. There is one txt file called A.txt in my desktop, I right click it and the context option shows Open With Code, and I open it. There is another txt file called B.txt in my desktop. While I right clit it and open it with visual studio code, both the two files are in the same window.
Is there any setting that the two files can be opened in two windows?
Not sure why you want that but actually there is a setting which behaves like you want when turned to "On":
Window: Open Files In New Window Controls whether files should open in
a new window when using a command line or file dialog. Note that there
can still be cases where this setting is ignored (e.g. when using the
--new-window or --reuse-window command line option).
You can find it via: User -> Window -> New Window
You can quickly open the settings dialog by pressing CTRL + ,

How to let VS Code open file using the default program of the operating system?

I am using the latest VS Code to write python Qt code (under Ubuntu 20.04). One obstacle is that VS code does not recognize known file types such as .ui files, and opens it as raw text or xml file.
By comparison, other editors such as eclipse opens the .ui file with its OS default program -- Qt Designer. With VS Code, I had to open a file manager and then find and double-click the file to open it the right way (the same as opening the file using xdg-open in terminal), which is quite inefficient.
Does anyone know of a way to configure VS code to open a known file directly using its OS default program?
There are two extensions that I know of that tackle this problem (no affiliation):
Open in External App
... with this extension, you can do it more simply. Just right click to the file, and select Open in External App, that file would be opened by system default application. You can also use this way to open .psd files with photoshop, .html files with browser, and so on...
The configuration implies that you need to manually set which app to use for which extension, so it doesn't simply use the default configured in your OS (at least not in my brief test).
Open
Opens files using the OS's default program for the file type
This does what it says out of the box, but the keyboard shortcut seems to fail. The command can only be triggered via the right-click menu of the file in the vscode file browser.

How to change folder that opened by default in VSCode?

I have small problem with VSCode folder, that opened by default.
Problem description: I start new instance of VSCode (trough File->New Window), and then if I choose File->Open Folder it opens dialog with my Windows user folder as starting point (C:\Users\MyUser)
Question: How can I change that folder in settings (if it possible)? So by default it will show as start point for example D:\development\ ?
At the time I write this answer, this is not possible. There are two problems on Windows, and one problem on Mac and Linux:
VS Code does not provide a default path to the file dialog 1. It does remember the last folder that you opened a file in, but that path cannot be used as a default because it is overwritten constantly.
On Windows only, Electron ignores the default path when creating a file dialog if the default path is a directory 2.
An extension also cannot solve this, because extensions are not allowed to modify the File menu 3.
I think the best option at this point is to pin a folder to the Quick Access area in Windows Explorer, as suggested in a comment, or to put an actual shortcut in the user profile folder.
Workspaces and File > Open Recent may also be helpful if you often open the same folders.
Your main problem is that you are unable to open your specific folder in VScode.
To solve that you can simply open the terminal/cmd in that specific window by just typing cmd in your search bar or just by pressing shift+right-click in that folder.
Now your cmd is open and you just have to type "code ." in the cmd and press enter to open the current folder in your VSCode.
In case that code . doesn't work for you then you have to add the Vscode in the environment variables of your windows.
Visual Studio doesn't provide a specific feature to open a specific path. But there is a solution to your problem. You are saying that you want D:\develpment as a default when you open VS Code. You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
make a shortcut on the desktop for vscode and then modify it and add the folder after the .exe command. This will default open that folder when you double click on it.
Visual Studio Code can be installed in two ways - User setup and System setup. I strongly believe you have User setup installed in your PC. Try re-installing it System-wide. That should probably fix your problem.
For more information: https://code.visualstudio.com/docs/setup/windows#_user-setup-versus-system-setup
PS: A lot more information is needed, you can share a screenshot of the window and elaborate more on it.

How to open a binary file (e.g. Excel) in Visual Studio Code with its default application

I use Visual Studio Code to work on projects that not only include program code, but also data files, e.g. in Excel format.
VSCode cannot edit such files, as they are binary. Attempting to do so shows a warning, and if you persist, the file is shown (as gibberish).
I've also tried to pass the file to the (CMD) terminal (right click, 'Open in Terminal'). In a regular CMD window that would invoke the default application, but that does not work in VSCode.
Is there a simple way that I can use from VSCode to open such files using the default applications?
The extension sandcastle.vscode-open does this. Install it, and you can open any file with its default application by right clicking on the filename in the explorer menu.
In v1.66 you can set a default editor for binary files and avoid the warning (see release notes: binary file):
Default binary editor
A new setting, workbench.editor.defaultBinaryEditor, lets you
circumvent the binary file warning and automatically open the editor
type of your choosing when a binary file is detected. You can select
the default binary editor from a dropdown in the Settings editor or
via IntelliSense in settings.json.
TBH, I am still investigating whether you can set this to some external application like Excel?

Can't get "View in Browser" or tool tip to work in Visual Studio Code editor

I can't get two features in Microsoft's Visual Studio Code to work.
1) I can't activate the "View in Browser" extension.
2) The tool tip feature isn't displayed in the editor.
Thanks in advance.
I would suggest you re-install the latest version from vscode
Open vscode, press F1, then type 'ext install[space]', [space] = space key;
Select "Extensions: Install Extension", then type 'view in browser'; Click bottom right 'tree' like logo to install extension; then Restart Now.
Open vscode, create an html file, then press Ctrl + F1 to view the html in your default browser.
Reference:
https://marketplace.visualstudio.com/items?itemName=qinjia.view-in-browser
Instead of using View in browser extension, I suggest you to use View in Default Application Extension.
Press F1 and narrow down the list commands by typing extension
Select the Extensions: Install Extension command.
Search for this extension by typing in the text view in default application
Once installed, you will be prompted to restart your instance of Visual Studio Code to use the extension
After saving your HTML file, press first ctrl+k and then ctrl+b.Your HTML file will be open in your default browser
Go To File - > Settings.
It will open a new window to the right.
Add your proxy settings there as:
"http.proxy" : "value".
Restart the Visual Studio Code.
It should work.