Jump to content

Search the Community

Showing results for tags 'Applescript'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 141 results

  1. Here is a simple workflow to create a text file with clipboard content in the current or top most Finder window/folder: 1. using a hotkey: the text is created with the following filename pattern: Clipboard - yyymmdd(hhmmss).txt 2. you can use newf key in Alfred (see screenshot) so you can write the first part of the file name (use CTRL key to remove the date and time from the filename). The default date and time was code this way in order to always generate an unique filename. Screenshot: http://d.pr/i/A2Kv Download: http://d.pr/f/5Jp7 This workflow is more a sample on how to use Shell/Bash and AppleScript together. Credits to phyllisstein and his workflow* and David Ferguson for helping. * http://www.alfredforum.com/topic/394-fixed-create-a-new-file-in-the-finder/
  2. I'm making a workflow that toggles an application feature on or off via a gui applescript. However, I'd like to have the workflow send a notification to the user indicating whether the feature has been enabled or disabled. How would I go about implementing this?
  3. Hi I've been moving all my hotkeys over to V2. I can get all the apps and files to open OK, but none of my Applescripts are working. (Three of my applescripts do stuff in Mail for the currently selected email, and one other launches app Minuteur and passes a number to it). I've tried both run script with usr/bin/osascript selected and run NSapplescript What do I have to do ? thanks k
  4. This workflow demonstrates several feedback scenarios and can be used as a template for your AppleScript projects. I will maintain an updated copy of this post on my blog: http://www.johneday.com/617/generate-feedback-in-alfred-2-workflows Overview: To generate feedback in Alfred, we use a Script Filter to pass a query to the xml.scpt AppleScript. The script then processes the query and returns a properly formatted XML string containing information for each item to be displayed. After you import the Generate Feedback workflow, launch it with the gf keyword to view my five examples. To reveal the xml.scpt you will need to edit, open the gf Script Filter and click the Open workflow folder button at the bottom of the window. Basic Usage: Add each item you would like to be displayed in your workflow to the itemList by passing a record containing the required labels to the xmlItem handler. For an in-depth description of each attribute, I have included pieces of David’s tutorial in the script’s comments. on run argv -- coerce the argv list to text set query to argv as text -- create an empty list to hold the items set itemList to {} -- Feedback item 1 set end of itemList to xmlItem({uid:"My uid", arg:"My arg", title:"My Title"}) -- Wrap the elements of the list with a declaration and return the list to Alfred return giveFeedback(itemList) end run xmlItem Handler Required labels: {uid:"My uid", arg:"My arg", title:"My Title"} Optional labels: subtitle:"My Subtitle" valid:"no" autocomplete:"Autocompleted text" icon:"icon.png" icon:"public.plain-text", iconAttribute:"filetype" -- iconAttribute must be used with icon icon:"/Applications", iconAttribute:"fileicon" -- iconAttribute must be used with icon Advanced Usage: Characters < > & " need to be escaped properly for XML. To insert items that may contain these characters, pass the string to the clean handler along with a true/false value to remove leading and trailing whitespace. clean(" Title with leading whitesplace & < > \" characters, trimming true", true) Alfred uses the uid attribute to learn which results are selected the most and then uses this information to sort your feedback. If you would like to manually arrange the returned items, use the uuid handler to generate a unique uid. In Alfred’s next release (after 2.0.2), this issue will be resolved and the item UID attribute will be optional. uid:uuid() Along with the workflow, I have included a list of file types that may be used as values for the icon label when paired with iconAttribute:”filetype”. See http://imgur.com/a/0zXVX for the corresponding icons.
  5. I've noticed that when using a script trigger, alfred will evaluate the entire script from the first character typed in an argument, but the user can continue to type and the script will keep reevaluating. However, I'm trying to build in functionality so that, if on the first keystroke the script will run for a long time, subsequent instances of the script will skip the long processing steps, at least until the initial processing is complete. I've implemented it like so: Check if long_process needs to run, based on a flag in a plist file If long_process needs to run, set the flag in the plist and start long_process once long_process is complete, clear the flag If long_process doesn't need to run, start short_process (to provide feedback to user) However this doesn't work. It appears that short_process will never run, despite multiple keystrokes being entered. How can I make it work, or at least somehow run the long process on a different thread?
  6. Hi, I want to create a workflow to resize my selected Images. first I created a File Action and the a Run NSAppleScript with the following text on open (_files) tell application "Image Events" to launch repeat with _file in _files try tell application "Image Events" set _image to open _file scale _image by factor 0.5 save _image in _file close _image end tell end try end repeat end open It dow not work Can somebody help me please?
  7. Hi, Okay, please forgive me for any mistakes I make here! This is my first, very basic, AppleScript workflow. It is probably terribly done and completely wrong, but I was proud and wanted to share it! It's very simple, just creates a note in the Notes app. It can either close immediately after or (by pressing alt) can leave the app open. I apologise if this workflow is a duplicate of someone else's, I couldn't find one by searching when I looked, as I wasn't originally planning on creating it myself! I was hoping somebody could give me some advice on extending the workflow to add a notification when successful. I wanted to display the contents of the note in the notification, but using {query} just results in a blank message! Any corrections, improvements and modifications are very welcome! Workflow available here: http://d.pr/f/H7f6
  8. I cannot figure out how to do this. I've created a trigger and an action to "run script" and pasted the script in there. How do I link them? Am I on the right track even? In Alfred 1 I just used the global hotkeys feature.
  9. tell application "System Events" set theText to name of current user end tell display dialog theText default answer "" with hidden answer set the adminpass to the text returned of the result tell application "Finder" set iconPath to (get name of startup disk) & ":Applications:Utilities:Boot Camp Assistant.app:Contents:Resources:DA.icns" as alias end tell do shell script "bless -mount /Volumes/BOOTCAMP/ -legacy -setBoot -nextonly; shutdown -r now" password adminpass with administrator privileges I have this applescript that restarts into windows and prompts for admin password before it does so. I can't figure out why it works in the applescript editor perfectly fine, but when run through alfred it doesnt prompt for the password or run at all....thoughts?
  10. I've got a couple things I'm trying to accomplish, and Applescript is the only way I've found out how to do it. Unfortunately, it apparently doesn't translate into the languages Alfred uses, so I need an interpreter. This is what I want it to do with a hotkey: Any and all help would be greatly appreciated!
  11. Just a simple workflow to trigger a crazy AppleScript I cooked up a few months back. Keyword is "ingredientlist" (mine triggers on "ing"). Triggering it will run the AppleScript in the background and let you know once it's done. Download it now or keep reading for more details. How it works: The AppleScript grabs the URL of the front Safari window (only Safari for now) and pipes it through Recipe Distiller. Then it strips out everything but the ingredients on the resulting Recipe Distiller page. Each ingredient is added as a task to an OmniFocus project named "Recipes". You must have a project named "Recipes" in OmniFocus. Mine is a Single Action list. A notification will trigger when the script is done adding the ingredients to OmniFocus. Caveats: Will only cleanly pull ingredients from sites that Recipe Distiller can understand. Almost everywhere I've found a recipe I've gotten clean results. Some sites may grab something other than ingredients. Keep an eye out for errant items. There will always be a blank task before and after your ingredients. This is a bug that I now use as a feature; it surrounds the newly imported ingredients so I don't confuse them with other tasks. The script does not save the URL or page title from Safari. When I use this script I also grab that info with this OmniFocus bookmarklet. Once the ingredients are all in OmniFocus I nest them under the task created with the recipe name and URL. Why would anyone want to do this? Because you can. Oh also because sometimes I'm at the market and I look at interesting recipes I've saved and can then grab any ingredients I need. So go get it and get cooking. Download ingredientlist-to-of.zip
  12. Hi there, This workflow request follows some discussion with Vero here. My wish would be that the contact filter from Andrew passes through the workflow an argument which I can use in AppleScript. It currently passes the full path of the contact file, from which I can easily get the id of the person, but I can't get my script to get infos from this ID. Thanks to this ID (or anything else), I'd like to get for instance the birth date of the selected contact (as it is not displayed in the Contact Viewer ). This last part of the script is not a problem to me. The problem is the connection between the selected contact and the AppleScript. I hope I'm making it clear enough Thanks for your help!
  13. There are a few things I want to do with workflows, but I don't want to have to plead for someone else to write the script for me. Could someone direct me to an online resource to learn the basics of script that will work in Alfred workflows? Thanks!
  14. Hi, Just checking out some Applescript and noticed that Alfred appears to have installed its dictionary many times. Guess this isn't intended?
  15. My file management scheme requires me to add prefixes to the names of files, which are then picked up by Hazel and handled in various ways. My applescript skills are admittedly crude, but here is my workflow (driven by a file action) to prompt the user for a prefix string and then add that string to the names of all the selected files. Right now, the default prefix in the dialog box is "archive-" but that's easily changed from within the simple applescript. The workflow is here: http://d.pr/f/bDxq But if you just want a peek at my weak applescripting chops, here you go: on alfred_script(q) set prefixValue to display dialog "Enter prefix string: " default answer "archive-" set AppleScript's text item delimiters to tab set fileList to every text item of q repeat with theFilename in fileList set theFile to POSIX file theFilename tell application "Finder" set fileAlias to theFile as alias set fileName to name of fileAlias set newFilename to (text returned of prefixValue & fileName) set name of file theFile to newFilename end tell end repeat end alfred_script Enjoy!
  16. Hi I've created a workflow that uses AppleScript to create a reminder in reminders with a due time and date. You can grab a copy here :http://honestpuck.wordpress.com/2013/01/15/reminders-workflow-for-alfred-v2/ which is also a blog post explaining the syntax for the time and date. Enjoy, // Tony Williams
  • Create New...