Jump to content

GuiB

Member
  • Posts

    366
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by GuiB

  1. About Typinator problem to include image with hyperlink inside a formatted text snippet. On my side I'm able to do it... or maybe I didn't read you correctly, but here is how I do it: Create a new snippet Put the abbreviation that you want Put the snippet as formatted text (or rich text... don't know how it's written in English, mine is in French at the moment) Write the text that you want as you want it Open the image that you want to include in Preview (or maybe you could just copy the file from Finder and skip #6, but I get different size) Press CMD+A to select the image and then copy it (CMD+C) Go back to Typinator and put your cursor where your want to paste your image Paste the image (you should now see it in your snippet) Select you image inside the formatted text snippet Just above the text field of the snippet and just on the right of where you set the snippet as formatted text, there's a drop-down menu with an A icon. Click there and at the bottom you would see "Modify link..." (or something like that), then click there (or do CMD+K instead of going to this menu) and paste your URL. Now you should be set!
  2. I was about to tell the same thing as @deanishe about pasting the file to the email application since most of them put a pasted file as attachment, but I needed to go and then @deanishe said it. But to make it more complete and easily done by you or anyone reading this post. Here is a simple example using AppleScript to paste a specific file into the front application. (Just change the first line to the path of your specific file and you should be set to go) set filePath to "/path/to/your/file" set the clipboard to POSIX file (POSIX path of ((POSIX file filePath) as alias)) tell application "System Events" to keystroke "v" using command down Then any Snippet Expansion application that allows to run an AppleScript should be fine with this... I've tried it in Typinator (I'm also a user) and it's working and there shouldn't be a problem in Alfred but by using a custom Workflow with a Snippet trigger that run the script. One advantage to Alfred using a Workflow is that this could allow you to use one snippet to popup a list of different file so you can select which one you want to insert as attachment. (Maybe it could be possible with Typinator with some Input fields, but it's not something that I looked into yet)
  3. The output of you script should only be a JSON string, but you have "echo input $userInput" that send "input $userInput" (-> "input the") to stdout and just before the JSON string (which I assume output a correct JSON string). So, you should remove or comment this first line so it is not sent to Alfred.
  4. @deanishe, I didn't know that one! Thanks for mentioning! However, the problem with using "alfred:ignore" is that this would make the commented file to be ignored completely from all Alfred searches. However, what @nikivi want is to exclude specific items from a specific file filter, so they can be found from certain file filter and not from other. Therefore, I think my solution of a custom comment/tag name would be best. @nikivi, I don't think it's so much more annoying to comment files than to copy their path and paste them inside the File Filter (like you tried before, which didn't work). From how you speak, this seem to be only certain files, so wouldn't take too long and everything would be good after. If it's because you are afraid to find those files from other kind of searches that look for Finder comment, than make sure to use a custom comment that you are sure you won't write by accident.
  5. I don't get exactly what you want... your want to exclude every folder or you want to exclude specifics folders? If your question is the first one, then using 'kMDItemContentType' as Metadata field with 'NOT' ticked and 'public.folder' as value should do the job (it works on my side). You problem with your folder '~/learning' is because it's added by Alfred's Default Results Search Scope. Look inside 'Features > Default Searches > Search Scope > Include folders in Home' if it is checked. If so, all you folder inside your Home folder should appear in your search since they are explicitly added. Or folders that are added inside the Alfred's Default Search Scope list should appear as well. Was that your problem or you have other folder from different places ? If your problem is to exclude specific folders, then the problem with Spotlight/mdfind is that you can add folders to search inside those specific folders, but you can't exclude some to filter them from the added parent folders. So, a solution would be to add every folders that you really want to look inside. I know this could add a pretty big list of folders, so I thought of another solution... Just add a Finder Comment or a Tag to the folders that you want to exclude and do the same thing as the 'kMDItemContentType' and exclude files that are marked with your comment/tag... For example: add a comment to your '~/learning' folder (ex: 'AFF_Exclude' -> for Alfred File Filter Exclude) and in the Metadata Field insert 'kMDItemFinderComment' and tick the 'NOT' box and in the value insert 'AFF_Exclude'. This should work and would keep your default filtering as it is, but with extra exclusion of specific items. About your 'kMDITemWhereFroms', from Apple documentation, this should "describes where the file was obtained from. For example, a downloaded file may refer to the URL, files received by email may indicate the sender’s email address, message subject, etc." So, this is not so useful in your case.
  6. From my understanding File Filter and Alfred’s File Search use the same technique (thanks @Andrew for confirming ). However, from my understanding, a default File Filter won't use the same configuration has your Alfred's File Search if you've filtered some file types in your Alfred's File Search section, so it won't show the same output ( @nikivi , if this is what you're wondering). @Andrew , please correct me if I’m wrong, but in the 'Basic Setup > File Types' section of a File Filter, it’s written: "Leave empty to search all file types". So, from my understanding, by default, a File Filter would show any files of any types, even if you've checked some file types in the 'Don't Show' section of the File Search, those would be shown. So, if you don't want them, you would also need to filter them using the same technique as above; using the 'kMDItemContentType'
  7. Ah, just thought of a better way Just use a 'kMDItemContentType' in the Metadata Fields so you can directly filter the file type wanted instead of using the file extension... This should be better and the opposite of Alfred filter by type. Look at the screen capture to how to put it. If you're wondering about the Value to use for the file type that you want to exclude, first go into the 'Basic Setup' section and drag & drop the a file of the type that you want to exclude in the 'File Types' section. Copy the first value and remove it from the list. Go back to the 'Advanced' section and paste it.
  8. It's because you're hiding the file extension in Finder so the "Display Name" doesn't use it. Therefore, you need to use another metadata field to filter your file, you should be able by using a 'kMDItemAlternateNames' or a 'kMDItemFSName' field instead of a 'kMDItemDisplayName'
  9. This is not the best solution, but I don't know if there's a better one... Using a file filter, in the 'Advanced > Fields' section you can tick the 'NOT' checkbox in the when adding Metadata fields. So, you can use this to blacklist file that contain certain keywords. Here is a screenshot to show you how to blacklist items that contain '*.cpp' or '*.h' in their Display Name (so using the file extension to filter different types). You can try different combination using different metadata fields to best filter what you don't want.
  10. ok, so simply whitespaces = simply spaces at the moment (other whitespace elements are for later) Thanks for confirming and I'll keep modifying my strings while a wider range of word boundaries isn't possible. However, to make it clearer for the user and avoid any confusion, maybe you should specify that word boundaries are delimited by spaces instead of using the word "whitespaces" since whitespace habitually means any character that add space between word in a text (I mean, newlines and tabs are also whitespaces, so it's a little confusing)
  11. Sorry @Andrew for asking you directly, but I think you're the only one that really know the answer since you're the one implementing it... I've been testing/using the new Match Mode of the Script Filters and I thought that when you said word boundaries that would mean word separated by white spaces. However, from testing this seems to be only true for word delimited by spaces. So, any other white spaces directly in front of a word (newline '\n' or tab '\t') would make this word to never match... At the moment I'm modifying the string before setting the 'match' item of the JSON to replace '\n' and '\t' with space, but I was wondering if this was your intention to only allow spaces to delimit words ? Here is a workflow to show you an example. Filter the results with the word 'match' [wbf match] and you will see that not all items are kept: https://nofile.io/f/sx6xst0g3RC/Example-Word+Boundary+Filtering.alfredworkflow I'm repeating myself, but thanks for this addition in Alfred! Best!
  12. Or, alternatively, use an Automator Folder Action that activate an External Trigger from a workflow. To create one: Create a workflow in Alfred Add an External Trigger object Copy the content of the External Trigger inside the Sample Code section Open Automator Create a new Folder Action At the top right of the actions list, select the folder that you want to be watched Insert an Applescript action In the Applescript script, insert this: on run {input, parameters} repeat with f in input (* Paste the content of the Sample Code of the External Trigger in Alfred here and change the "test" string to f; Ex: *) tell application "Alfred 3" to run trigger "extTriggerName" in workflow "workflowName" with argument f end repeat end run Save the Folder Action Modify your Alfred Workflow to manipulate the added files in the folder
  13. @deanishe, fair enough! I thought that since Alfred is used to rapidly launch things, then I thought that it should make sure to launch the right thing. But, yes, what should be the right thing to do could depend on the situation and is questionable... Launch the action as soon as possible to make it as fast as possible or wait and make sure to launch the latest run action to be sure to have the complete action even if it's a little longer to activate. I get you that we should pay attention to Alfred output to make sure we run the right thing and that it's not possible to fix all problems. Now I'm questioning myself about what is best between the two way. But for sure, the best thing is to try to make your script as fast as possible so there's no problem of this sort
  14. @deanishe, I don't know if this is exactly the case with @dpyy's workflow, but I won't get to the conclusion that the problem is only with the workflow... I mean, I've experienced the same situation with workflows that needed to parse the user input and took some time to do it. I know it's best to make your workflow as fast as possible, but sometimes there is some processing happening that needs a little more time to accomplish than a simpler workflow and that we can't get around. For that, there's some "Run behaviour" that can help to reduce latency (ex: Terminate previous script), but even with that, the problem is that Alfred doesn't wait when we press enter for the latest Run to return. So it executes the workflow with a partially written query instead of the full one. So, I would say this is a bug and @Andrew, wouldn't it be preferable for Alfred to wait for the latest script to finished when there's one running while we pressed Enter ? This way, we would get the returned output that uses the full query when we typed it fast and knew what we wanted without needing to wait for the full output of the workflow to appear in Alfred's items. Here is a workflow to show you (just a simple sleep command to delay the output): https://nofile.io/f/dyVRF1PX30M/SlowWorkflowOutQuery.alfredworkflow Just write something fast and rapidly it Enter and see the output in the notification. If you press Enter before Alfred received the latest Script Filter output, then you will send a partial query.
  15. Or a solution would be to change your hotkey to something else... I first thought about setting your hotkey to shift+space, but on my system it seems Alfred doesn't allow it (I may have already used it somewhere so that would be why Alfred doesn't allow it, or it doesn't allow it in general... but you may have better luck on your side if you try). Alternatively, I think you would have less trouble by using a hotkey that use a double tap on modifier, since I think it would be more natural to release the key, before typing... Maybe shift+shift would be best since that if you keep shift while typing, you would get a uppercase letter instead of nothing or a special character. Or a last solution would be to create a workflow with a hotkey object that the action is set to "Show Alfred" and that the Trigger behaviour is set to "Wait until modifier keys are released" so you are sure that when you see Alfred, everything is released and you shouldn't have any problem to type anything you want. Look in the attachment for a picture to show you how to set the hotkey trigger. However, if you want to keep ctrl+space, you would need to change it first on the Alfred Hotkey (just put something that won't interfere with anything else, since the workflow trigger would be your new Alfred Hotkey). If you are wondering, I thought at first that it may work by setting the Trigger behaviour to "Simulate modifier keys release" so the ctrl key is released programmatically, but it didn't work.
  16. @nikivi, great! I'm glad you found the problem!
  17. Hey guys (@deanishe and @nikivi) ! Thanks for the kind words! I like to help people when I have some time and this helps me to learn new things as well! However, in this case, I never played with Go and AwGo, so I'm not sure I'll be helpful, but, @nikivi, I just downloaded you workflow from your latest version you uploaded on transfer.sh (https://transfer.sh/DgP3l/web-searches.alfredworkflow). I installed it, looked inside, saw there's a hotkey to activate it (ctrl+alt+s) so I did it. Alfred appeared with your workflow items, then at the top there was a mention that a new version was available (not sure if it appeared on the second activation, but it appeared automatically). So I pressed Enter to run the update (if I remember well, I needed to press 2 times Enter before something happened, don't know why). Then, I got prompt by Alfred to update my version (with the standard Alfred interface to install/update a workflow). Then I'm now set at version 2.1 (v2.1)... and things seem to be working... So, I'm wondering what is the problem exactly ? I thought it was the updating fonction wasn't appearing or working correctly, but it seems to be good from my side ? or maybe I didn't read well or read too fast ? Best!
  18. To look for a Workflow directory, do a secondary click on the name of your workflow on the left pane of the Worlkflows section of Alfred Preferences. Then, click 'Open in Finder'; this would bring Finder to front and show the directory of your workflow. In this directory, you would see scripts file (if you have created an external one), icon that you've added to your workflow and a info.plist file that is the main file that Alfred read to execute your workflow (all the objects connexions and what is run). So, if you didn't created an external file for your script, then you can open the info.plist file and you should see your scripts embedded inside this file
  19. Snippet trigger objects in workflow seem to always being registered for expansion even if the workflow is not set as Enabled since they work all the time (the workflow is activated/run when writing the Snippet keyword if the workflow is enabled or not). Using: Alfred 3.5 Pre-Release - Build 871 ------------------ After some testing, Alfred seems to register/unregister the snippets at startup. I mean, if I disable a workflow that have a snippet trigger in it, the workflow will keep working until I restart Alfred. Same thing if I want to enable a workflow, if I enable a workflow that was disabled, I need to restart Alfred to really enable it.
  20. To have multiple cursors in an application, the application need to allow it and since Alfred snippet expansion are made to be used in any application, this is not possible. Or, Alfred would need a popup interface to edit the snippet before outputting it to the other application (which would be great). However, now with the Snippet Trigger object in Workflows, it is possible to get around this by creating a workflow that ask for the string that you want to insert at multiple places. To give you an example, I think the one at '[+] -> Getting Started -> Snippet Triggers' would give you some good ideas for this kind of things. Look at the third one ('hellomsg') for a way to ask for input and write to the front application. In the Copy to Clipboard object, just use '{query}' multiple time to write the same string at multiple positions... Let me know if it's not clear enough, or here is a simple version showing your Example 2: https://nofile.io/f/R4PJxm45pfc/Write+Query+at+multiple+position+in+Snippet.alfredworkflow
  21. @deanishe, ok, thanks for the info! I don't plan on writing one either, but it's nice to see how things are working. @CincyTriGuy, it may be easier to create an Automator service like this one: http://www.officeformachelp.com/2010/11/create-a-service-to-attach-files-to-a-new-outlook-for-mac-mail-message/
  22. @deanishe, thanks for correcting me, I had the feeling their was something that wouldn't work exactly with Outlook... So I've searched inside Alfred for a place about the Email feature, but couldn't find anywhere to modify it. Out of curiosity, where is this Applescript plugin supposed to be installed in order that Alfred uses it for the Email action ? Or you mean that we need to create a specific Workflow using an applescript that interact with Outlook (so another file action) ?
  23. Thanks @deanishe, I'll have a look and try this! Thanks for your work
×
×
  • Create New...