Tag Info

New answers tagged

0

You need to use a tool that can write a plist such as defaults. defaults write ~/Desktop/gametocheat/my.cheat.preference '{ "Filter" = { "Bundles" = (foo); }; }';


1

Try the following: set cheat1 to the quoted form of text returned of (display dialog "Enter Cheat" default answer "99 Gold, super health, unlimited Grenades..") set newText to quoted form of "I am now adding a few test lines" do shell script "echo " & newText & " >> ~/Desktop/test.txt" do shell script "echo " & cheat1 & " ...


0

While battling this same problem I came across this answer to a not-so-related question and decided to try it and it seems to work for me. Simply replace delay 5 with do shell script "/bin/sleep 5" and get the same result.


-1

I was actually looking for this shortcut to do quick grammar checking on a selected word in gmail. Usually, painted the word (option+shift+left arrow) and then right click to see the options (and I hate using mouse). For this particular case, there's Chrome shortcut, which is [cmd + shift ; — or — cmd :] to display grammar check. Then you can cycle through ...


0

I just discovered that a nested tell will stop the errors, ie tell application "System Events" set activeApp to short name of first process whose frontmost is true tell application activeApp repeat 5 times display dialog "Hello world" giving up after 2 delay 2 end repeat end tell end tell Still don't ...


0

This might help you with a couple of methods to overcome your issue I believe: http://stackoverflow.com/questions/6964486/osascript-syntax-error-expected-end-of-line-but-found-command-name-2741


0

At the moment it doesn't appear to be possible to get or set properties on music played through Apple Music. However you can heart a track that is stored locally or played from your iCloud Music Library. tell application "iTunes" set loved of current track to true end tell


2

Your script above is running two different scripts. One is changing the working directory to your user desktop folder (~/Desktop). The other script is downloading www.google.com and putting it in a document in your root directory (/), which doesn't have permissions to do so. You can fix this by reduce it to one statement of do shell script like such: do ...


0

My approach to launching Character Viewer ("CharacterPalette") proved otiose as there is an OS X shortcit I was previously unaware of: ctrl+cud+space opens character Viewer. For reference this call in Applescript is: tell application "System Events" key code 49 using {control down, command down} end


2

It’s not AppleScript, but is there a reason why the time command isn't applicable? It’s used like this: time <command> time find /opt time tar xf bigFile.tar.bz2 It gives output like this: real 0m0.044s user 0m0.000s sys 0m0.008s


1

Instead of having an Automator/AppleScript applet to run this command, you can use Terminal to automatically run that command upon launch. In Terminal, go to Terminal > Preferences. In the General pane, under "Shells open with:", select "Command (complete path):" Enter your command in the text field. Now, when Terminal opens, that command will execute ...


0

Daring Fireball described how to get message IDs in an Applescript.


1

Every do shell script command starts a new shell, so the cd doesn't have any impact on the following command. So you would be better of with running tell application "Terminal" activate do shell script "cd ~/Desktop/Quake3ISO && hdiutil mount ~/Desktop/Quake3ISO/Quake\\ 3\\ Arena.iso" delay 5 do shell script "cd ...


0

AppleScript is built by Apple, for Apple (though unfortunately support has steadily declined since the move from 10.6.8 to 10.7) While it is possible to do what you describe with AppleScript (or any language, with enough blood, sweat, tears, and coffee), it will be much more difficult than using Facebook's API to view your notifications (or using OS X's ...


0

You can download application Color Picker and save follow AppleScript code as an Service(use Automator to create). on run {input, parameters} --click button to select color from screen tell application "System Events" set isRunning to (name of processes) contains "Color Picker" if not isRunning then set front_app to (path ...


1

Alright, I think I found the answer: tell application "Terminal" do script "sudo /usr/local/bin/openconnect --user={user} {host}" activate end tell


0

This works tell process "SecurityAgent" to click button "Allow" of window 1


0

tell application "Finder" set desktop position of (selection as alias) to {200, 200} end tell


0

Correct code below for interest. --APPLESCRIPT _main() on _main() set mm to {} tell application "Mail" repeat with m in (get selection) set mm's end to m's content & linefeed end repeat end tell set r to my _retrieve_data(mm) do shell script "printf '%s' " & r's quoted form & " > ...


1

You need to just add the variable to the end of your predetermined path string, like this… set LastNameInitial to "" repeat while LastNameInitial is "" display dialog "What is the first letter of your last name?" default answer "" set LastNameInitial to text returned of result if LastNameInitial is not "" then mount volume ...


0

I've whipped up this nice code snippet, try it out, it should work well for your specific application. set device to "Ethernet" set getInfo to paragraphs of (do shell script "networksetup -getinfo " & device) set ipAddress to ((item 2 of getInfo) as string) set subnetMask to ((item 3 of getInfo) as string) set router to ((item 4 of getInfo) as string) ...


0

From comments… As it would appear that many people across the net are struggling & failing to get set properties to {visible messages:msgList} to work at all, it might be simpler in the long run to just pop up a count of unread/unflagged messages & optionally sort by flagged then unread for easy discovery in the Mail window. I added in a 'sort by ...


1

You are close. I think the problem is that you have created two properties (accountName and passwordName) for your text fields but then you are taking the stringValues from those text fields and then trying to store those string values back into themselves. If you store the values in separate variables the code works successfully. -- IBOutlets ...


0

There is a lot of information about how to write Applescript code in general and how to use it to send keystrokes available on the net. System Events, Key Code and Keystroke looks kind of interesting in your case and should get you started.


0

tell application "Finder" to if name extension of item 1 of (get selection) is "mov" then set name extension of item 1 of (get selection) to "mp4"


0

Intheory, s.o. could copy this or clone this file, name it document.wflow and put it inside a folder structure like this /pdfToJpeg.workflow/Contents/document.wflow and open it in Automator. This is the structure of a .workflow file when you look at Package Content. This workflow will ask for a file to select, extract any page as pdf, rename each file ...


0

set mountedVolumes to do shell script "ls /Volumes/" if (mountedVolumes contains "thisDriveName") is false then mount volume "afp://thisUsername:thisPassword@thisIPorHostname/thisDriveName" end if


0

OS X follows these steps when mounting a drive: It creates a raw device in /dev/ (for local disks only), it creates a folder in /Volumes/, then it mounts the drive to that folder it just created. That folder creation step is probably what you read. The shell script you linked is missing the following command: mkdir /Volumes/somenetworkdir Then the command ...


0

script from a forum. tell application "System Events" set textToType to "text here" delay 3 repeat delay 1 keystroke textToType keystroke return end repeat end tell soruce: http://www.sythe.org/runescape-scripts/1590890-auto-typer-script-mac.html Replace within the quotes of "text here" to what ever you need. If ...


-1

--here's an applescript to copy/paste that might work (unless I misunderstood the question...) display dialog "would you like to open imovie?" tell application "finder" open "imovie" end tell --p.s. I havn't tested this, so i'm not sure whether it will work


1

I am by no stretch of the imagination an Applescript expert, but this is what I have gleaned from my own fumbling over the years. I'd appreciate corrections if there are any inaccuracies, or better methods.. but with some 'why it works' for newbies ;-) What you're actually doing is asking Script Editor if the string "/Users/[User]/skfhshfkh/hfjhsfhsj/" ...


5

Thanks to budakpisang for this: In terminal, you can turn wifi off and on with these commands networksetup -setairportpower en1 off networksetup -setairportpower en1 on en1 being wifi. Try networksetup -listnetworkserviceorder to see whether that's right for you or not. Here's a one-liner to toggle between on and off networksetup -getairportpower en1 | ...


0

Here is a script by maeks84 which does the same for iPhoto that might help you with accomplishing the same for iMovie (need to post as answer due to the length). Code inserted in case it ever goes down.. --maeks84@gmail.com --http://maeks84.wordpress.com property libraryPath : "Macintosh HD:Users:Path:to:iPhoto Library" --Determine if iPhoto is open and ...



Top 50 recent answers are included