Jump to content

Subject22

Member
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Subject22

  1. The AppleScript included in that workflow is a little unreliable. On my machine it will often execute both try blocks, causing Do Not Disturb to be toggled twice (effectively resetting it to whatever it was before I invoked the workflow). Here's an improved version without that issue.

    tell application "System Events"
    	set toggled to false
    	option key down
    	delay 0.1
    	
    	try
    		click menu bar item "Notification Center" of menu bar 2 of application process "SystemUIServer"
    		set toggled to true
    	end try
    	
    	if not toggled then
    		try
    			click menu bar item "NotificationCenter, Do Not Disturb enabled" of menu bar 2 of application process "SystemUIServer"
    		end try
    	end if
    	
    	option key up
    end tell
    

    And here's the workflow.

  2. I haven't actually touched the workflow since my last post, I don't think. The version in the first post should be current. Is there something wrong with it? If so, please let me know and I'll do what I can I'm moderately busy and this little project isn't a priority so there may be a delay in fixing any issues, but I will try to sort something out if I can. 

  3.  

    Try running this bash script, it will recompile all .scpt files inside ~/Library/Application\ Support/Alfred\ 2/Alfred.alfredpreferences/workflows

    cd ~/Library/Application\ Support/Alfred\ 2/Alfred.alfredpreferences/workflows
    for f in user.workflow.*/*.scpt; do
        plaintext=$(osadecompile "$f")
        # | sponge |
        echo "$plaintext" | osacompile -o "$f"
        echo "Recompiled $f"
    done
    
    

    Thanks for this! If I get a chance I'll come back to it Appreciate the help!

  4. This is broken in the Yosemite public beta (probably do to some menu bar reorganisation?) Anyway, I tinkered a bit but couldn't fix it. The best I came up with was this Applescript: 

    tell application "System Events"
    	tell process "SystemUIServer"
    		try
    			key down option
    			click menu bar item 1 of menu bar 2
    			key up option
    		on error
    			key up option
    		end try
    	end tell
    end tell
    

    Note the use of the try block. In the current version of the workflow the option key gets stuck pressed down, preventing you from typing normal characters until you restart System Events (or reboot your Mac).

     

    I can see the script above clicking the Notification Centre icon, because the icon flashes blue when I run it. It doesn't actually toggle Do Not Disturb though.

  5. Using the in keyword doesn't help, unfortunately, as the content of my files isn't relevant to the search - only the titles are.

     

    Using a file filter isn't quite what I'm after either. I don't want to do this for just some particular group of folders, but for any folder I choose, in a more ad-hoc manner. The example I gave was just an illustration of a more general problem I'm having. It seems that Spotlight offers more flexibility in this situation, ironically.

     

    Thank you for your help, it's greatly appreciated :)

  6. When running this workflow I see the following error in Alfred's debug pane. No output makes it to the notification action.

     

     

    [ERROR: alfred.workflow.action.applescript] {

        NSAppleScriptErrorAppName = "Alfred 2";

        NSAppleScriptErrorBriefMessage = "every item of trash doesn\U2019t understand the \U201ccount\U201d message.";

        NSAppleScriptErrorMessage = "every item of trash doesn\U2019t understand the \U201ccount\U201d message.";

        NSAppleScriptErrorNumber = "-1708";

        NSAppleScriptErrorRange = "NSRange: {425, 14}";

    }

     

    Hard coding a value for the relevant line causes the workflow to run fine. The script runs fine in AppleScript editor (although bizarrely it gives a value of zero for the number of items in my trash - so if anyone knows why that is I'd be grateful for their input).

  7. I have a lot of files containing the word "outline". Every course I take has a course outline, and most of my assignments have an outline too. Because of this, searching outline in either Spotlight or Alfred is unproductive as the resulting list is very long. In Spotlight however I can simply add an additional search term to narrow my results, e.g.: cosc421 outline yields the course outline and the outline for the course assignment as the top two results. Parfait! But typing this into Alfred gives zero results, because there are no files with names containing all those words.

     

    Is it possible to have Alfred apply multiple search terms? Are there any Workflows that offer this functionality? If no to both, has anyone heard of any plans to add such a feature?

  8. I'm not using any sort of auto-cleaner, but I did try repairing my permissions. There wasn't anything there that seemed like it would affect Finder or Alfred, but you never know. The only other odd thing that came out of it was this message:

    Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent” has been modified and will not be repaired.

    But again, that doesn't seem relevant to me, but it may tell you something for all I know.

     

    Thanks for your help, it's very much appreciated :-)

  9. I haven't encountered the issue I originally reported here for a good long while now, but another similar one has occurred a few times over the past few months. Occasionally certain applications do not appear in Alfred's search results. For example, Finder. The problem always goes away again after some time has passed (sometimes a few minutes, sometimes a few hours), though things such as reloading Alfred's cache do not seem to have an effect.

     

    No%20Finder.png

    Here's the output from the Alfred Metadata tool.

    /System/Library/CoreServices/Finder.app
    
    Internal File Metadata
    ======================
    
     Display Name: Finder
        Alt Names: Finder.app
        File Type: com.apple.application-bundle
         Comments: 
         Keywords: 
        Last Used: 
    
    Raw mdls File Metadata
    ======================
    
    kMDItemAlternateNames          = (
        "Finder.app"
    )
    kMDItemCFBundleIdentifier      = "com.apple.finder"
    kMDItemContentCreationDate     = 2013-09-19 06:03:05 +0000
    kMDItemContentModificationDate = 2013-12-18 07:26:38 +0000
    kMDItemContentType             = "com.apple.application-bundle"
    kMDItemContentTypeTree         = (
        "com.apple.application-bundle",
        "com.apple.application",
        "public.executable",
        "com.apple.localizable-name-bundle",
        "com.apple.bundle",
        "public.directory",
        "public.item",
        "com.apple.package"
    )
    kMDItemDateAdded               = 2013-10-25 02:57:26 +0000
    kMDItemDisplayName             = "Finder"
    kMDItemExecutableArchitectures = (
        "x86_64",
        i386
    )
    kMDItemFSContentChangeDate     = 2013-12-18 07:26:38 +0000
    kMDItemFSCreationDate          = 2013-09-19 06:03:05 +0000
    kMDItemFSCreatorCode           = ""
    kMDItemFSFinderFlags           = 0
    kMDItemFSHasCustomIcon         = (null)
    kMDItemFSInvisible             = 0
    kMDItemFSIsExtensionHidden     = 1
    kMDItemFSIsStationery          = (null)
    kMDItemFSLabel                 = 0
    kMDItemFSName                  = "Finder.app"
    kMDItemFSNodeCount             = 1
    kMDItemFSOwnerGroupID          = 0
    kMDItemFSOwnerUserID           = 0
    kMDItemFSSize                  = 47203974
    kMDItemFSTypeCode              = ""
    kMDItemKind                    = "Application"
    kMDItemLogicalSize             = 47203974
    kMDItemPhysicalSize            = 54501376
    kMDItemSupportFileType         = (
        MDSystemFile
    )
    
    
×
×
  • Create New...