Tag Info

New answers tagged

0

Your code seems to work ok on my 10.6.8 (Snow Leopard), though I didn't launch it from launchd. I did something very similar to monitor my battery. The script automatically hibernates my system after giving a 60s count down using a 'flashing' dialog box. Because, like you, the dialog box would sometimes get buried, I gave the dialog box a timeout and ...


1

No need to run a terminal command to do this. Applescript can handle it without the need of a terminal command. set myList to {} tell application "Finder" set fileList to name of files of folder "Applications" of startup disk repeat with currentFile in fileList copy currentFile to the end of myList end repeat end tell choose from list ...


1

I'm all for people learning how to script things, but for day to day use and flexibility, reimplementing parts of Hazel by NoodleSoft is less powerful and efficient for a general purpose solution. Again, kudos to Froggard and Inspired Life for the excellent answer and the practical question.


3

What always will work is encoding the icon file with base64 -b 64 (to keep the lines short enough), include it into your shell script as a here document and decode it on the fly. To create a base64 encoded version of your icon file, run base64 -b 64 -i path/to/icon/Myicon.icns > myicon.base64 (This you only need to do once). Then open your shell ...


3

I would create one script that monitors both folders. My language of choice for this is Python. AppleScript is not terribly well-suited to this kind of operation. The basic idea is to listen for FSEvents on the two folders in question, and when one occurs, quickly unschedule the event stream for the other folder, do some conversion and sync operation, then ...


1

Undesirable Behaviour There is no intended way to add trusted root certificates without requiring authorisation from the user or an administrator. Any method that manages to add a trusted root certificate without confirming, at some stage, the credentials of the user would be considered a serious security bug. What is the Risk? Once a root certificate is ...


1

@grgarside's solution is nice, but it is vulnerable to script injection, which can be a major security issue when this is used to e.g. display log file contents or something similar. This should be safer as it escapes double quotes: #!/bin/bash /usr/bin/osascript -e "display notification \"${*/\"/\\\"}\""


0

You can use Quicktime 10.x to split the movie into multiple clips, and then trim the individual clips. When you're done editing the individual clips and you save/export the movie, you get exactly what you want: one single, continuous movie, sans the parts you trimmed. Split a movie into clips In QuickTime Player, drag the playhead (the small ...


0

Automator and AppleScript are two very different things. For Automator actions for a specific app, search for the name of the app in the Actions search bar. For AppleScript, open the Script Editor, then open the dictionary of the app by pressing ⇧⌘O and selecting the app. Apps not in the list probably don't have an AppleScript dictionary.


0

tell application "Finder" repeat with thisFolder in (items of (get selection)) repeat with thisItem in (get items of thisFolder) move thisItem to (POSIX file "/Users/Jordan/Desktop/0/") end repeat end repeat end tell


1

This might be a bit of a sledgehammer approach by Applescript compared to Automator's 'move' command, but as that's how the OP approaches it... To do it as an Automator Service, so it's easy to hotkey it… 'Service receives selected 'files or folders' in 'Finder''. on run {input, parameters} tell application "Finder" set selected_items to ...


1

Actually I would use Automator. Set up a service and call it what you like. Under the "Actions" tab select "Files & Folders". Then double-click/select "Move Finder Items". Then select the location you want said items to move to. Save it and then you can add it to the custom keyboard shortcuts. To do this go to "System Preferences" and under ...


0

The Applescript you are using for Quicktime is incorrect and you are asking it to do command that are from the standard additions. I path to QuickTime will not understand this and fail. Similarly: set frameOne of this_item to track (beginning) set frameEnd of this_item to track (end) QT will not know what beginning and end are You should read the ...


2

This worked for me: global thanks on run set thanks to false end run on idle set battStatus to do shell script "pmset -g | grep \\*" if battStatus contains "AC Power" then if thanks is false then say "thank you" set thanks to true end if else set thanks to false end if return 1 end ...


0

Apple removed "bounce" from the Mail dictionary. So "bounce eachMessage" does nothing and the only effect is the message being deleted ("delete eachMessage")


0

Here is my script to export to PNG written for Snow Leopard. You can adjust to suit your needs easily enough... EDIT: Here is your code incorporating the original code I posted. This works as you described you wanted the applet to work. property type_list : {"M4V ", "mpg4"} -- e.g.: {"PICT", "JPEG", "TIFF", "GIFf"} property extension_list : {"mp4", ...


0

I found Automator's "Launch Application" action to be as quick as anything else, and the only way to do this without third party software. BetterTouchTool is a free application that can be used to launch applications using hotkeys. iTerm 2 is a Terminal.app replacement that can be shown/hidden using a hotkey (if it's running).


0

I downloaded Keyboard Maestro and was able to get what I needed by writing a macro. I have a new favorite program. I kind of wish I had tried it sooner.


1

You were looking in the right direction… though you cannot actually do this easily for a right click item - so long as there is a menu item in the same app, it's simple. I've only quickly tested this on Safari & TextEdit - whichever app you use must already have those 2 command options somewhere in their menu structure. System Prefs > Keyboard > ...


2

Apple's documentation describes how to call commands which have both direct parameters (the text) and named parameters (the using). In this case, you would do this: var ScriptEditor = Application("Script Editor"); ScriptEditor.includeStandardAdditions = true; ScriptEditor.say("Hello", {using: "Alex"})


0

If you have Network menu bar item/icon in top right menu bar. You can do: tell application "System Events" to tell process "SystemUIServer" value of attribute "AXDescription" of menu bar items of menu bar 1 end tell To get connection status. For example: {"Wi-Fi, four of four bars, with WiFiNetworkName.", "Battery: Charged ", "Clock"} Then you can ...


0

From playing about with opensnoop, what seems to happen when you click "Pause" is that Photos (by way of cloudphotosd) adds something like the following two lines to a file within your photo library called private/com.apple.cloudphotosd/CloudSync.noindex/State.plist <key>pausedUntilDate</key> <date>2015-04-30T23:57:01Z</date> ...


0

By nickname do you mean the short user name of the logged in user? Nickname seems to be only available in contacts and the user might not have set his contact card. You can get short user name by getting system info set _info to system info set _nickname to short user name of _info



Top 50 recent answers are included