Jump to content

shau-kote

Member
  • Posts

    21
  • Joined

  • Last visited

Everything posted by shau-kote

  1. Support dfay, it's a very nice feature. But is there a way to disable the behaviour in the particular workflow? One of my workflows requires a ability to quickly select the first and the last items in Script Filter list. Sometimes up arrow selects the last item, but sometimes it switches to the previous query. It's not good for me.
  2. Well, it's seems to me like almost all really works properly. Except for main area of workflow editor. Apparently it caches icons for workflow objects. But it is a trifle. Thank your for your application and advices, Andrew.
  3. Thank you for so quick answer. Just to clarify: I just put icons into workflow folder, name them "icon.png" (for workflow) and "{uid}.png" for workflow objects, and all will work properly. Did I get it right?
  4. Hello. When I create icons for my workflows, I resize them and optimize through tinypng.org according to Andrew's advice. But I've noticed that when I drop an icon into workflow details dropdown or into some object (for example, Script Filter) configurator, Alfred modifies the icon. And the modified icon has a much larger size. More than ten times larger. The size is even larger than the icon had before optimizing. I wonder why does Alfred do it? And if Alfred does it, maybe it is pointless to optimize icons?
  5. It is fascinating, but it is irrelevant for the topic answer in all senses.
  6. Hello. It is a simple workflow to manage Tunnelblick connections. Type vpn and it displays all the Tunnelblick connections. You can narrow the list by typing part of the connection name. Select the connection and press enter to toggle its state. Packal Page GIF with demo: Hope it will be useful for anyone besides me.
  7. Oops. I am an idiot. Thank you, ctwise.
  8. Yes, I already know about terminal-notifier, thank for Vítor, who uses it in many of him workflows. terminal-notifier is fairly handy even though it doesn't seem to me like a tidy solution.
  9. Yes, I was investigating the Alfred's environmental variables just now; unfortunately this method doesn't work. But the environmental variables seems very useful in Run Script Action. Thank you, deanishe, I've overlooked it. I know that *.applescript can be compiled by osacompile to *.scpt. But it is unnecessary headache to do it.
  10. 1. When I do display notification in NSAppleScript I see a notification with nice and meaningful Alfred icon but when I do the same in Run Script Action I see a notification with miserable and irrelevant AppleScript icon. 2. NSAppleScript cache compiled AS. It is not a notable optimization but it's better to do it than not to do. Here is my two reasons, but I do not think the reasons are sufficient to use "a very messy solution". There are another ways.
  11. Oh. Apparently I have. But I understood the same point while writing the first post. But my problem is: I want run NSAppleScript in workflow directory. Well, I will try another solutions. It is not a fatal problem, just a inconvenience.
  12. Thank for your workflow, ctwise. But I am wondering there is not the menudump source on your GiHub. I see only binary executable in alfred-workflows/menu-bar-search/. Have you still issued the source? Am I searching in a wrong place?
  13. Thank for your reply, FroZen_X, but there is no new information in topic you adduced: yes, I can use Run Script instead of NSApplescript. Alack, I don't still see simple and tidy way to get into workflow folder using NSApplescript.
  14. Okay, I've seen on your RunCommand workflow, @Vítor. And I've noticed the trick with "keyword object with empty keyword value". It's very simple and effective. Thank your the excellent examples of workflows.
  15. Thank you, @Vítor for your RenameAction, it is a simple and visual example of External Action usage and at the same time it is an useful workflow. Keyword "rename to:" is slightly unpleasant but as I can see Alfred limitations don't allow get it out. And I don't see simple solution for the issue (only "black list" for keyword, but it does not seem like a neat solution). Also, little feature suggestion to @Andrew. Indeed I often need to store some data between workflow calls. It would be very convenient to have a workflow object(s) which allows to store some data therein and get and use the data later.
  16. Hello. When I use Run Script in my workflows, working directory for script is the workflow directory. It is very convenient. But with NSApplescript working directory is / (root directory). It makes troubles for me. Is there a reliable way to get (into) workflow directory in NSApplescript? Yes, I can hard-code it, but (1) it's awfully long and (2) I'm not sure how Alfred generates its name (can it change in future? will it the same on the other installation?). Thanks for you replies.
  17. Thank your so much again, deanishe. Your version works fine even in Script Filter. While in Script Editor both version works without producing errors. Indeed, AppleScript is inconsistent at times.
  18. Hello. Today I've experimented with Safari's windows management through Alfred & AppleScript and encountered with greatly strange issue. As you probably know, every window object in AppleScript has standard properties which are described in Standard Suite: id, name, miniaturized and the like. In Script Editor I can obviously get any of these properties and I thought I can do the same in Script Filter too. However when I try to get miniaturizable and miniaturized properties in a Script Filter's script, the script fails with an error "Safari got an error: Can’t make |miniaturized| of item 1 of every window into type reference." under number -1700. I've created this simple example to illustrate the issue: repeat with safari_window in every window of application "Safari" try log (get miniaturized of safari_window) on error msg number -1700 log msg end try end repeat When I run it in Script Editor it executes as expected and logs true/false values, but when I call it from Script Filter it produces errors and logs error messages: [STDERR: alfred.workflow.input.scriptfilter] Safari got an error: Can’t make |miniaturized| of item 1 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 2 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 3 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 4 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 5 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 6 of every window into type reference. Safari got an error: Can’t make |miniaturized| of item 7 of every window into type reference. Also it isn't a Safari issue. Other applications behave the same way. Can someone explain me, why is it happening? Thank you.
  19. D’oh, backward compatibility, I was afraid of such explanation. I utterly agree with you — it is a real shame for Python. I often use Python 3 as scripting language and I've never encountered with the issue. After your first post in this thread I cannot firstly believe in that the same problem can exist in Python. Alack, I was apparently wrong. The issue is not a big problem for me while I use Python 3 for my local workflows (due to your advices), but I hope eventually to see Alfred v3 with better compatibility with my favorite scripting language. Thank for you help and explanations.
  20. Thank you for the comprehensive answer, deanishe. Well, third option is fine for me. I use Alfred's Script box in bash mode anyway, because Alfred can't use custom interpreter (by the way this is kind of sad). But why do Alfred use so inconsistent environment? It seems to me that it is a bug, which is not too hard to fix. Or are there reasons for such behavior?
  21. Hello. I try to write my first script filter plugin, but I've encountered a unexpected trouble with Unicode (non-ASCII) characters. This is a simplest example I could invent: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBar</title> <subtitle>foo bar is a test item</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) (I call it from script filter as /usr/local/bin/python3 outputtest.py.) It works fine until I want to add some non-ASCII characters: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBær</title> <subtitle>foo bær is a «test item»</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) Then it fails: [ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last): File "outputtest.py", line 12, in <module> print(xmloutput) UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 88: ordinal not in range(128) Why it happens? I can't believe that Alfred do not use Unicode in input/output. I think the root of problem in something else, but I can't find out where is it.
×
×
  • Create New...