New answers tagged

1

You can just use the volume name with diskutil though, there's no need to get the identifier: $ diskutil unmount VolumeName Volume VolumeName on disk1s1 unmounted


0

First, the best way to run a cron script as root is to add it to the root user's crontab. sudo crontab -u root will allow you to edit the root crontab. Once you are doing that you don't need to use sudo. As for running it every Thursday, check the man page for the crontab table man crontab -s 5 and it will explain all you need to know.


0

This answer comes close to answering the question, but I need to start using sudo su - instead of sudo su in order to switch from regular user to root or the /var/root/.profile script won't execute. Now, unless Apple changes this, regular users by default will get the Bash shell, instead of the Bourne shell, which is unlike the root user. So, for those ...


3

mount | grep /Volumes/foo | cut -d ' ' -f1 or mount | awk '/Volumes\/foo/ { print $1 }'


0

When run from Automator how are you inputting your password when prompted by sudo? You're probably not being prompted if you're just running it the same way as if in Terminal. You'll need to add some AppleScript code and run it via osascript so you're prompted for an Admin password: osascript -e 'do shell script "sudo diskutil unmountDisk disk3" with ...


0

I've come along something very similar a while ago but there was no package needed. I'll try my best to explain how it worked. Firstly, an iTunes backup is required. Next, you will need to access that backup on your computer. There was a program for OS X (and probably for Windows too) that could read these backups. In the backup, there is GPS data that can ...


0

I have completed the same with below string : compName=${loc::9}; which actually removes 9th character of the stored variable .


1

Here is an answer to get right the pathname of .. from AppleScript: Get Current Path to Script within AppleScript and Append Subdirectory Anyway, the actual construct you got: /path/to/folder//myscript.pl is a correct pathname to your Perl script. The 1st / is coming from the terminal one coming from container: /path/to/folder/. Hence your built find ...


0

Strangely enough the best solution seems to be not to use Apple's own tools but the Python code because it has 3 advantages not being limited by: output file resolution (it works till 1024x1024) input file format (tried with ICNS and PNG) permissions to install (define it as a function)


0

Strangely enough the best solution seems to be not to use Apple's own tools but the Python code because it has various advantages not being limited by: output file resolution (it works till 1024x1024) input file format (tried with ICNS and PNG) permissions to install (define it as a function)


-1

The following works: osascript -e 'display notification "Hello world!" with title "Hi!"'


0

I appreciate your suggestions guys. Allan and User3439894's suggestion are both correct and really helped me a lot. I tested this in 10.11.4 and used the scripts above to 10.9-10.11. I probably just need to email the users to relaunch google chrome for the settings to take effect. The reason why I want to disable this print preview in chrome for mac is ...


0

First I have to say that at the moment I'm not where I can ssh into another Mac to test this, however I'm going to offer it anyway as I believe this can work. Some assumptions on my part... Each of the systems to be touched have more then one User Account. You will use Administrator Credentials to modify the target .plist file. Notes: In order to touch ...


0

Use the sudo command The command is sudo -u username command So, after you SSH in as the admin, issue the command: sudo -u <username> defaults write /Users/<username>/Library/Preferences/com.google.Chrome.plist D isablePrintPreview -boolean true That will set the preferences value for the particular user you are interested in without having ...


0

Having read through the Services Implementation Guide I'm going to have to say no to using only a shell script. If you do not want to use Automator then you'll have to create a Service using Xcode and unless you can perform that level of programming, then Automator, as slow and clunky as it may be, is looking pretty good. Just for the heck of it, I took ...


0

(The manual way) Cmd-click (or right-click) the Acrobat window title and choose the parent folder. Ă…pen Terminal and drag the PDF-file into the terminal window. Copy the file path from the Terminal window.


0

So here's an AppleScript that I pasted together with the help of some other answers and the AppleScript reference. This puts the URL of the frontmost Acrobat document to the clipboard, e.g: file://localhost/Users/Your%20Username/Documents/Some%20Folder/Filename.pdf tell application "System Events" tell process "Acrobat" set thefile to ...


0

In Acrobat, like in many applications, you can drag-and-drop the document icon from the window's title bar to other applications, which hands over the file's path (hold down the mouse button slightly longer before dragging). For example, if you drop the icon on the Desktop, the Finder creates an alias icon. If you drop it in a TextEdit document, the PDF is ...



Top 50 recent answers are included