Tag Info

Hot answers tagged

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 ...


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 ...


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"})


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 ...


2

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

Try using open instead of launching the program directly. open more closely matches double-clicking to launch the AppleScript application. open your application To do this, replace the Program key value pair in your launchd job ticket with a ProgramArguments array to provide the path to your AppleScript application: <key>ProgramArguments</key> ...


1

Found this which did the trick. tell application "System Events" to tell process "Adobe Photoshop Lightroom 5" set frontmost to true tell menu bar 1 tell menu bar item "Photo" tell menu "Photo" tell menu item "Set Flag" tell menu "Set Flag" click menu item "Rejected" end tell ...


1

I have redone the script, again. That code before was ridiculous tbh. I got a little ahead of myself... Let's try this again... Save this as a "stay open" application again, named anything. You'll just have to quit it when you want to stop scrolling, and start it up again when you want to continue. I advise putting it on your Dock for easy access: global ...


1

Since you said that your script doesn't work at all, we shouldn't yet care about how to change x from another script. I think one should use System Event's application process. I couldn't test it with Chrome but it should work as expected (when the key code is correct which I don't know). Set x to the number of loops you want, here 5: set x to 5 tell ...


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 ...


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

@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 \"${*/\"/\\\"}\""


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

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 > ...


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.



Only top voted, non community-wiki answers of a minimum length are eligible