I am using Gnome with Archlinux. My default file manager is Nautilus.
How do I add recommended apps in "right-click" menu?
(Ubuntu-like)
They listed only, when I click "Open with other Application"
But it's too long!
Items in Nautilus's 'Open With Other Application' dialogue are added to to the 'recommended' list automatically after using it once (successfully).
Create a desktop-file in ~/.local/share/applications/ to add another item to the list of available applications.
Example entry to mount disk images (like LUKS container) writable (copied from /usr/share/applications/gnome-disk-image-mounter.desktop):
[Desktop Entry]
Name=Disk Image Mounter (rw)
Comment=Mount Disk Images writable
Exec=gnome-disk-image-mounter --writable %U
Icon=drive-removable-media
MimeType=application/x-cd-image;application/x-raw-disk-image;
Terminal=false
StartupNotify=false
Type=Application
NoDisplay=true
Refer to man update-desktop-database or man desktop-file-install for more information about desktop-files.
To install nautilus-action on Ubuntu, run simply this command via the Terminal:
sudo apt-get install nautilus-actions
(or equivalant packet manager as yum or pacman)
After the installation is complete, let's now see a quick example of how to add an extra action to the right-click menu with nautilus-actions.
The example consists of adding to the right-click menu the "Edit With Gimp" action to edit, for example, image files using The Gimp (Image Editor).
_Using the dash search "nautilus-actions" and click Nautilus-Actions Configuration.
_Under the Action tab, fill the following fields:
Context label: The text that will be displayed in the right-click
menu, in our example, it's "Edit With Gimp"
Icon: This option allows to select an icon for your action (optional)
_Open now the Command tab and fill in the following fields:
Label: Enter any label of your choice for your action.
Path: Enter the path to the program you want to use using the Browse button. For our example, we will simply type "gimp".
Parameters: Click the Legend button to get suggested parameters. In our example, we will use the %f parameter to be able to edit image files with The Gimp.
_Log out the current session and log on again, or simply restart Nautilus with these commands from the Terminal:
nautilus -q
nautilus
Related
I have a Selenium WebDriver based script to automate file uploading. It uploads list of files one by one. I use AutoIT script to handle dialog window, file chooser window. Parameter $CmdLine[1] contains the path of actual file.
ControlFocus("Open a file","","Edit1")
ControlSetText("Open a file","","Edit1", $CmdLine[1])
ControlClick("Open a file","","Button1")
I execute it from Java code as following:
Runtime.getRuntime().exec(autoITExecutable);
It opens dialog window, so it can't work without focus on browser window.
File upload field works like this demo:
https://encodable.com/uploaddemo/
I ran simple script for the link you gave and it works great
import os
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://encodable.com/uploaddemo/")
driver.find_element_by_name("uploadname1").send_keys(os.getcwd() + "/test.csv")
driver.find_element_by_name("email_address").send_keys("none#getnada.com")
driver.find_element_by_name("first_name").send_keys("Tarun")
driver.find_element_by_id("uploadbutton").click()
Try your code in similar format as shown below and try:
WinWaitActive("File Upload") // enter the title of the pop up
Send("Path of the file to enter") // enter the path of the file to upload
Send("{ENTER}") / press enter
I have a PowerShell Script that I like to run with a Visual Interface (GUI - with Windows Form elements) Everything is working so far but I have one big problem:
Is it possible to display the command pane from PowerShell on the created Windows Form?
For Example: In one part of my PowerShell Script I am running the following command:
Upgrade-SPContentDatabase DBName
This command requires to confirm some messages with "Yes/No" that will be normally displayed in the command pane from PowerShell... Can this be done over the Windows Form so that I can hide the PowerShell-Script Window in the background?
Or is there any other way to display it in a new window that comes up?
Screenshot:
Any Ideas?
A messagebox (GUI) is different from a prompt. As long as you run a script in powershell console(not ISE), prompts will show up in the console. (There may be a setting to make them GUI like in ISE). A workaround would be to try and disable the confirm-prompts in the script, and create a messagebox yourself.
Try the following in your button's click-handler:
$handler_button1_Click=
{
$n = [System.Windows.Forms.MessageBox]::Show("Are you sure?", "Confirm", [System.Windows.Forms.MessageBoxButtons]::YesNo)
if ($n -eq "Yes") {
#Ignore confirm dialogs with -Confirm:$false
Upgrade-SPContentDatabase DBName -Confirm:$false
}
}
I recently made a certificate in Photoshop CS6 and for some odd reason the file was saved as:
certificate (file type: .5)
Is there a ways that I can convert this file to a format that I can use in Photoshop? When I try to open the file using Photoshop it says:
"Could not complete your request because it is not the right kind of document."
The same happens when I try CS5 also. I need to be able to edit this file again in Photoshop. Thanks!
My problem was that I had file extensions hidden. I'm using a Windows 8 Operating System so to change that I had to:
Left Click File Explorer> Left Click "View" Tab> Check the box "File name extensions".
This makes it so I could view the extension at the end of the file name.
This allowed me to delete the (.5) to "certificate4.5", to add (.psd) "certificate4.psd"
It opened in CS6 perfectly and is editable.
Before when I had changed the end of the file name I couldn't delete the (.5) so it would do this: "certificate.5.psd" Making it a file that isn't recognized by anything (.5.psd).
I'm using iOS 6 simulator with the shiny new Web Inspector in Safari.
Question: Is it possible to automatically load the Web Inspector when the iOS 6 web application loads?
I'm using PhoneGap/Cordova and have a lot of javascript loading on startup. I use console.log() extensively for debugging and would like it to load Web Inspector once the application starts.
Currently when I hit Run on Xcode, the app loads and I setTimeout on my first function so I can rush over to Safari and attach the Web Inspector on that page.
I'd much prefer to remove this step and add an automated step that would load the Web Inspector directly.
Any other solutions?
This is a partial solution. This opens the debug window of Safari with one click which is a lot better but not automatic.
Open Script Editor on your mac (Command + Space Bar and type in Script Editor)
Paste in this code:
-- `menu_click`, by Jacob Rus, September 2006
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
-- is the active application, arranging the frontmost folder by date.
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on
set {appName, topMenu} to (items 1 through 2 of mList)
set r to (items 3 through (mList's length) of mList)
-- This overly-long line calls the menu_recurse function with
-- two arguments: r, and a reference to the top-level menu
tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
(menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
end menu_click
on menu_click_recurse(mList, parentObject)
local f, r
-- `f` = first item, `r` = rest of items
set f to item 1 of mList
if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
-- either actually click the menu item, or recurse again
tell application "System Events"
if mList's length is 1 then
click parentObject's menu item f
else
my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
end if
end tell
end menu_click_recurse
menu_click({"Safari", "Develop", "IOS Simulator", "index.html"})
Once the simulator has opened, click run on your script (you might need to allow the script editor in the settings the first time).
(Optional) You can save your the scripts as an app so that you don't have to have the script editor open.
(this answer is a more detailed version of Galatin's previous answer)
It's mid-2014 and there's still no elegant solution to this that I know of, but I like the idea of adding a short pause with setTimeout to your app's init code. If adding a setTimeout call isn't possible, you can also issue window.location.reload() from the Safari console to restart your application with the benefit of full debugging.
1) Inside your OnDeviceReady handler add debugger;
onDeviceReady: function() {
debugger;
// the rest of your device ready code
}
2) Run the application via xcode or cmdline.
3) Attach the debugger via Safari->Develop->Simulator->Appname -> index file
4) Open the console view of safari and enter:
Window.location = "";
5) The app will reload and the debugger will attach on the first line of onDeviceReady().
6) Debug as normal.
Is there a way to launch an Explorer window and highlight a file in that folder with WPF ? I've already tried the following :
Process ExplorerWindowProcess = new Process();
ExplorerWindowProcess.StartInfo.FileName = "explorer.exe";
ExplorerWindowProcess.StartInfo.Arguments = ConfigFile.File.FullName;
ExplorerWindowProcess.Start();
... but that opens the file (in my case an XML file) with the default application in Windows Explorer, which I very much don't want. I know that the Aptana tools available for Eclipse allow you the ability to select a file in the Eclipse project browser and show the file in Explorer exactly as I want, but I need a way to implement this in my WPF app.
Explorer Command Line Arguments
http://support.microsoft.com/kb/152457
Explorer [/n] [/e] [(,)/root,<object>] [/select,<object>]
/n Opens a new single-pane window for the default
selection. This is usually the root of the drive Windows
is installed on. If the window is already open, a
duplicate opens.
/e Opens Windows Explorer in its default view.
/root,<object> Opens a window view of the specified object.
/select,<object> Opens a window view with the specified folder, file or
application selected.
You will also want to put quotes around the filename like so:
startInfo.FileName = "explorer.exe";
startInfo.Arguments = "/select,\"" + ConfigFile.File.FullName + "\"";