Jump to content

WalterBeiter

Member
  • Posts

    22
  • Joined

  • Last visited

Posts posted by WalterBeiter

  1. 31 minutes ago, vitor said:

    Regarding notificator, you only run the setup once: to solidify an icon and a bundle ID. It’ll save it to an app. You keep that app inside the Workflow’s directory and call it as needed. It will work on all your Macs when you share/sync the Workflow amongst them.

    → maybe I'll try that. 

     

    31 minutes ago, vitor said:

    If you want to return multiple variables, you’ll need to either return a JSON in the same format as the JSON Utility or you’ll do it like in other languages: returning everything in your own format and then parsing it yourself. I would recommend against AppleScript, though. Unless it’s absolutely necessary, doing complex tasks with it is more pain than it is worth.

    → AppleScript is mandatory for what I'll try to accomplish, so I think I will try that notificator thing. If that does not work or get to complex, I will skip this part and use the standard icons. But having the script editor icon show up whatever notification is displayed is annoying, especially when scripting multiple applications. 

     

    Thanks for all the quick help. 

  2. 29 minutes ago, vitor said:

    We can’t properly help you without access to your Workflow.

    → The workflow does not exist yet, I am still developing the AppleScript but I ran into the problem of not knowing how to display custom notifications with a custom icon. So I though I would just do this using Alfreds notifications...

    Sorry for not providing enough details. I thou they would distract from the main problem. 

     

     

    Quote

    You can’t from an AppleScript script — a notification with a custom icon needs to come from an app. Take a look at notificator (disclaimer: I’m the author) for a quick way to make such apps. I use it in my own Workflows.

    → notificator could work. I installed it, but it requires me to first run that setup, saving that app somewhere and then call it again. This would be a lot of file handling which is not that nice... Where do you store the icon, the app,.. etc.

    Not quite sure how I would implement this into an AppleScript. I know I could launch notificator with the do shell script command, but how do I bundle the custom notificator app with the script? I want to use this with every Mac. 

     

     

    Quote

    Yes. The simplest way is to not have it in succession. There’s no apparent reason why the next step would need to come only after the notification has fired. Instead, make two connections:

    7G3bSU9.png

    → this could work, but how to I return multiple variables in AppleScript and then importing them in the second AppleScript? And how do I post a notification of just one of them? 

    And it would require dividing the applescript wherever I post a notification. 

     

    Edit: How do I specify a custom icon in this notification? I can't find an area where I drag and drop an icon.

     

     

     

    Bottom line: If this gets to complicated, I will just give up and stick with the script editor icon. 

  3. I want to use Alfred notification for displaying data that I got using AppleScript. So the workflow basically gathers an information using an AppleScript, returns that information back to Alfred wich should display a notification and then the AppleScript should continue or another AppleScript should start, which should get the variables of the first AppleScript. 

    The reason for this is that I cannot figure out how to use custom icons in notifications within AppleScript. I wanted to use Alfred for this, since I can configure notifications how I want. So the goal is to return information from an AppleScript back to Alfred, Alfred is displaying those information and continues the AppleScript. Is this possible?

  4. I am using macOS 10.13 with Alfred 3.5 Build 875. 

     

    Whenever I hit the shortcut for Alfred and start typing, everything starts to lag. Every character that I press is delayed for at least half a second. The search result itself appear to be fast as usual, but the typing lags. This happens every time, even after restarting the mac. 

     

     

  5. 40 minutes ago, deanishe said:

    Paste the whole file in here:

     

    https://jsonlint.com/

     

    Thank you, I had to remove the following part:

     

    ,{
        ** second translation configuration goes here (same keys as before) **
    }

     

     

     

    Now, is there a way to use both directions in this workflow without having to choose the direction first? For instance I would like to type in "hello" and "Hallo" and the workflow would detect the language and translate it? Or it would simply display both translations?

     

     

  6. 14 hours ago, deanishe said:

     

    Looks like you broke the JSON file.

     

    my dictaSettings.json file looks like this:

     

    [{
        "downloadedDictionaryFile": "/Users/David/Library/Application Support/Alfred 3/Workflow Data/de.nieting.DictCC/cmkdkkkgmm-8718512140-eiiiie.txt",
        "languageOrderInDictionaryFile": [{
            "identifier":"de",
            "completeName":"German",
            "icon":"icons/icon.png"
        },{
            "identifier":"en",
            "completeName":"English",
            "icon":"icons/icon.png"
        }],
        "supportedDirection":"both"
    },{
        ** second translation configuration goes here (same keys as before) **
    }]

     

  7. Hey there, 

     

    I am in urgent need of an alternative to the Leo dictionary workflow, so I found this. 

     

    Wanted to do the last step and finally parse that stuff, but I got the following error:

     

    python "/Users/David/Dropbox/Alfred Sync Folder/Alfred.alfredpreferences/workflows/user.workflow.9B955379-60E9-4C05-A5BD-D89026DF606C/parseDictsData.py" "/Users/David/Library/Application Support/Alfred 3/Workflow Data/de.nieting.DictCC"
    Traceback (most recent call last):
      File "/Users/David/Dropbox/Alfred Sync Folder/Alfred.alfredpreferences/workflows/user.workflow.9B955379-60E9-4C05-A5BD-D89026DF606C/parseDictsData.py", line 299, in <module>
        main()
      File "/Users/David/Dropbox/Alfred Sync Folder/Alfred.alfredpreferences/workflows/user.workflow.9B955379-60E9-4C05-A5BD-D89026DF606C/parseDictsData.py", line 124, in main
        settings = ujson.loads(open(os.path.join(dirName, "dictccSettings.json")).read())
    ValueError: Expected object or value

     

     

    Can you please update that workflow? I also had to run the fixum workflow to even start using the dict.cc workflow. Is there anything that can be done? 

    I really need a reliable german-english translator workflow. I used Leo every day. 

     

     

     

     

  8. I want to update a directory on my Raspberry PI and I want to use scp for this. 

     

    I've got a keyword which initiates a Run NSAppleScript action. This applescript launches Terminal and it should enter a command. But it won't open Terminal.

     

    on alfred_script(q)
      tell application "Terminal"
    	do script "scp -r /path/to/folder pi@192.178.168.20:/var/www"
    	activate
      end tell
    end alfred_script

     

    This Applescript action works flawlessly when used with a normal ssh command like "ssh user@server.com". But it does not work with scp. Any ideas? 

     

  9. I've got an applescript which opens a specific path in the finder. When implementing this applescript in Alfred it behaves different. 

    for instance, setting "q" to "~" (the home directory) will open the folder in the finder. 

    But passing "~" in alfred in my workflow as an argument will reveal the folder, not open the folder.

    I want it to open the folder, similar to how the go to function in Finder works. Not reveal it. 

    In Alfred I am using the Run NSAppleScript action and a keyword with an argument to trigger the script. 

    set q to "~"
    
    set folder_var to true
    
    set mypath to q as text
    
    if mypath = "~" then
    	set q to "/Users/David"
    else if "~" is the first character of mypath then
    	set mytext to text 2 thru (count of mypath) of mypath
    	set q to "/Users/David" & mytext
    end if
    
    
    set q to (POSIX file q) as alias
    
    if kind of (info for q without size) is not "Ordner" then
    	set folder_var to false
    end if
    
    
    
    
    
    if folder_var is true then
    	if mypath = "~" then
    		set q to "/Users/David"
    		set q to (POSIX file q) as alias
    	end if
    	tell application "Finder"
    		activate
    		make new Finder window to folder q
    	end tell
    else
    	tell application "Finder"
    		activate
    		reveal q
    	end tell
    end if

     

  10. hey there,

     

    My goal is:

     

    type "ms" in Alfred to trigger the keyboard shortcut "cmd-shift-7" to invoke the help menu in the current app. "cmd-shift-7" is the standard keyboard shortcut to do that, but it is cumbersome to use.

     

    What I tried:

    keyword → RunNSAppleScript

     

    my AppleScript:

    on alfred_script(q)
    
      	tell application "System Events"
    	   key code {26} using {command down, shift down}
      	end tell
    
    end alfred_script

     

    This does work on most apps, but not all apps, despite the short cut "cmd-shift-7" works in those apps. What am I missing here?

  11. Problem with getting startet with mjolnir:

     

    It says on the getting startet page (step 4):

    "Create ~/.mjolnir/init.lua, and at the top, require the modules you installed, e.g. like this:"

    I have created a init.lua file with textedit. Where do I have to put it, since .mjolnir is not an allowed name for a folder. It does not exist, or at least, I can't find it. 

    So what do I have to do? 

    I have no experience with lua and for now I just want to use it with this workflow for alfred.

×
×
  • Create New...