Duplicate greasemonkey script doesn't work - inexplicable - greasemonkey

This is just too bizarre.
I'm new to Greasemonkey, but I downloaded a script from userscripts.org and it works fine. I then created a duplicate of that script using 'New User Script' from the GM menu and then pasted the original script into the new script. I then disable the old script and enable the new script and the new script doesn't work.

You "pasted the original script into the new script" without any edits?
Some things that can go wrong:
The new script should have a different name -- other wise the script installation(s) could get corrupted.
Does the script have #require line(s) in the header? If so, then know that the necessary resources are only fetched during a pure install and this mechanism does not work when using the "New User Script" menu.
To resolve this:
Save the new script file to a handy folder, perhaps, C:\Work\YourScript.user.js. Do not use the windows temp folder as GM install is buggy there.
In Greasemonkey's "Manage User Scripts" dialog, Uninstall the new script (and any potential name-conflicts).
In the browser, use File->Open File and browser to your script (EG C:\Work\YourScript.user.js) and open it. The Greasemonkey Install dialog should pop up.
Install the script. The required resources should now be fetched and saved properly. You can check this by looking in the scripts install folder -- which will be something like:
C:\Documents and Settings\{Win Username}\Application Data\Mozilla\Firefox\Profiles\{Random string}.default\gm_scripts\YourScript\ on a windows system.
Make sure the "Included Pages" are what you think they are. You can check this in Greasemonkey's "Manage User Scripts" dialog.
Double check the script edits. In Greasemonkey's "Manage User Scripts" dialog, press the Edit button and inspect the code.
If all else fails, paste the full, unedited, script code here -- there's probably a syntax and/or code error we can help you with. Including the code is always a good idea.

You probably didn't set up any URLs for the new script to work on.
When you select "New User Script", one of the boxes is labeled "Includes (one per line)", which is a list of the URLs for which FireFox will activate this script. Although the script itself also lists these include lines, they are incorporated into the browser's settings only at install time, not as you edit the script.
Go and look at the #include lines in your script and add them to the "Included Pages" section of the "Manage User Scripts" page and you will most likely start to see some action.

Related

What is the correct way to install a script into a status-bar component in iTerm2

I know this will sound remedial, but I'm following the instructions on the iTerm site as best I can, but I think they're too outdated.
From the example scripts I'm testing the install of a JSON pretty print script, which links to this page for how to install.
After starting this script, navigate to Preferences > Profiles > Session. Turn on Status Bar Enabled and select Configure Status Bar. Drag the Status Bar Demo component into the bottom section. Select it and then click Configure Component
Now, the "Status Bar Demo component" component no longer exists. The script and action components that are in the current build (3.x) do not have an obvious way to specify the script.
When I do specify it the path where I downloaded it, it fails — which I presume is because the .its is a binary. Double-clicking the binary brings up some Finder(?) Security install dialog. When I read through the binary file I see strings about apple certificates and such, so I assume this binary is a signed zip file/package that includes the py script that does jsonpretty.
I do the security install, and then the unpacked .py file is at a file path I can target. I make that the target of a Status Bar component (script button), again following how to install. Clicking the component button in the status bar still fails, though. Selecting JSON text in the iTerm console, or selecting no text, doesn't have how it fails.
Where do I go from here to do an installation of the script?

failed to launch preferred application for category TerminalEmulator?

I get this error:
Failed to launch preferred application for category "TerminalEmulator".
Step 1
Go to applications and search for qterminal and open QTerminal.
This will open a terminal.
Step 2
Type sudo apt install xfce4-settings, hit enter, wait for process to complete.
Now you can use all your applications.
After a lot of scrapping through various answers which asked to install or update various things, all just was for NO LUCK!
Then I decided to do it in my own lazy way.
I donot have any problem with QTerminal, hence I just tweak some parts in the thunar and settings.
In thunar(file manager) > Edit > Configure custom actions > Open Terminal Here (If this tag is not available then create it or if there is multiple tags with same value then keep only one and delete other)>double click on it to open and customize it.
In the next box you'll see "command" which will be run when clicking on "Open Terminal Here". Just dont write any command manually. There on the right side a "Select Application" icon is present. Just click it and select your preferred terminal. Save this change and Bingo! you'll be opening the folder in your preferred terminal.
now you'll see the command (basically path to the terminal application with a modifier f to open folder). Select only the application path and copy it, we'll need it in step 2.
In this step we will set up just tweak setting
Setting>Keyboard>Shortcuts
if Ctrl+Alt+T is already defined here then just edit it or create new "Custom shortcut"
paste the copied path of the terminal (what we copied in step 1) in the command section. Save it
DONE!!! *** You can set any shortcut key for your convenience ***

Sublime Text strange behaviour

I have a strange behaviour on my Sublime3 editor. I just started using it, having not much experience with.
I add some code like
use Kakuki\Reports\Models\Campaign;
And on save the code is kicked out.
Apparently it seems that PHPTools package caused this issue. How do I configure this Package?
Try disabling PSR mode via the User Preferences.
From the "Preferences" menu, choose "Package Settings", "PHPTools" and then "Settings - User".
Paste { "psr":"False" } into that file. (If that file is not already empty, just add , "psr" : "False" to the last line in that file. )
Save the preferences file and create a new "New View Into File".
Any time you install a new Sublime Text package, it's a good idea to take a look at its configurable options. You can do this from the "Preferences" menu, and then "Package Settings", the name of your package and finally "Settings - Default". Most package developers will pre-populate this file with all of the available options and comments about what they do. Note that you shouldn't edit this file (it will be overwritten every time the package updates), but you can use this to inform your user settings as above.

Sublime Text "Unable to save"

I didnt change any file paths and everything was working fine. I made one quick change saved it ok, did another change and I went to save it and got the following error. How can I solve this. It will save other files ok
Unable to save
D:\xampp\htdocs\websites\dev.liverpool\style\main.scss
Error:
MoveFileEx(D:\xampp\htdocs\websites\dev.liverpool\style\.sublae1.tmp, D:\xampp\htdocs\websites\dev.liverpoolzstylezmain.scss) failed,
Access is denied.
seems it's because Windows or another program is blocking the file. Sublime text uses a temporal file instead of editing the file directly, and when you save the file uses a API command to move this edited file to the original, so this command has restrictions when one file is locked and Sublime shows this alert.
Maybe this setting {"atomic_save": false} will work for you.
Go to the path where you installed sublime text 2 and...
Right click on the sublime_text 2.exe file.
Go to its properties.
Go to compatibility section under this.
Set its privilege level to "Run this program as an administrator".
Now change settings for all users and there also check the field "Run this program as an administrator".
Apply the changes.
I just solved the same issue on Sublime Text 3 beta, Stable Channel Build 3065 by doing the following under Windows 7:
Navigate to the Sublime Text 3 executable file, wherever you have it installed.
Right-click it and select properties.
Click on the tab marked "Security"
About half way down the tab, on the right hand side, under the list of group and user names is this little button:
Click it.
If your machine is setup the way I suspect it is (otherwise you probably would not be having this issue), you should be prompted for your administrator account credentials. Enter them.
Now, select the Users group in the list, then take a look in the box at the bottom labeled 'Permissions for Users'. Put a check mark in the 'Allow' column for the 'Write' item.
Click 'Apply'
Click 'OK'
You should be set. What this does is it essentially gives Sublime the ability to write files while running with regular user privileges, no administrator level access required. Upon taking a better look at your error, what is happening is Sublime Text is creating a temp file for editing, rather than editing to file itself, then attempting to overwrite the original file with the temp on save. The problem is that the program is not being run by a user with sufficient privileges to perform the overwrite, hence the failure with an 'Access denied' message.
A simple and effective solution: Right-click on the file you want to save, in my case it is index.html, go to the properties and uncheck read-only.
The Sublime text will start working fine.
I have come across this error quite many times and by un-checking read-only file attribute of index.html, I am able to get rid of it
I found out more ways to fix this:
Close and reopen the Sublime Text windows or
Open the file with Np++, add a space, save, quit, then you're prompted by ST to reload the file, click yes, and it works again... or
Open the FTP console to see if there's a transaction in progress - then cancel it
In my case the SFTP plugin seems to be causing this problem, as when the FTP connection is timed out, the file which is waiting to be uploaded is being used, and you try to overwrite it.
This happens because you're using ScoutApp or Compass, they block your SCSS files because they are checking for changes as you specified for a directory for those files.
I suggest you reading this:
http://aspirecode.com/how-to-add-sass-support-in-sublime-text/
Good luck!
On mac using a remote volume sometimes I experience this. The solution is to remove the temp file then save again and all fixed.
IE: if you are working on test.html then the temp file would be ._test.html
Remove ._test.html then save again.
For Mac-
Try changing the destination from 'Macintosh HD' to 'Documents' or any other folder.
Worked for me.
The plugin of Superlime solved this problem. It tries to save the file as root in SublimeText.
Reference Link: https://github.com/azubr/Superlime
Try switching your SublimeText process priority to higher level in process manager (it has to have higher priority than your scss compiling app, if you're using one).
It seems to have worked for me.
if it's not working after doing all suggestions, reinstall the program
On Mac I saved the file in Home directory and it gave me this alert, later when I re saved the file again this time in Document directory the file is working now. Using SublimeText 3.
I found this occurred when the folders are read-only. Right-click on the folders where your site is contained and see if read-only is selected in the properties.
Just open it as an administrator.
Because I want to edit anything and write as admin all the time, I set this program to always open as an administrator using "Configure Applications to Always Run as an Administrator".
Just got your file folder properties which you want to save and deselect to read only attribute.

Execute batch-file from browser

i have got a batch-File. I mostly have to execute it when i'm in my browser (Firefox).
So i dont want to go to the directory and execute it. I want to have something in my browser.
First i thought about making a firefox-add-on. Something like a button, which executes my batch-file. But I failed.
Then i made a bookmark to the file, but it only shows me the content of the batch-file.
Is there any other option to execute a batch-file from the browser?
EDIT: I have found an add-on that creates an button to execute files:
https://addons.mozilla.org/de/firefox/addon/external-application-button/
I don't know a way you can run this from a browser, but perhaps you don't need to. I'd create a global keyboard shortcut. You haven't mentioned your OS so I've assumed Windows.
Go to your desktop, right-click and select New > Shortcut.
Browse to your .bat file.
Name the shortcut whatever you like - probably best to use yourfile.bat shortcut or similar.
Right-click your newly-created shortcut and select Properties.
On the Shortcut tab, click into the Shortcut key area.
Press Ctrl+Alt+B. I've used B for bat - you can use what you like, although some shortcuts may be used already in your browser - test and adjust if necessary.
Click OK - you're good to go!

Resources