Mahmud315 Posted October 9, 2016 Share Posted October 9, 2016 On 2016. 8. 23. at 0:39 AM, Martino1983 said: Hi, the workflow doesn't work for me (Alfred 3.1). The error message is "[2016-08-22 17:34:15][ERROR: action.script] 0:135: execution error: Alfred 3 ha trovato un errore: "j new folder " non è in grado di capire il messaggio “«event alf2Sear»”. (-1708)". Can you help me? Thanks in advance. Martino same here. it doesn't work with Alfred 3.1 and Sierra Link to comment
lycopodiopsida Posted November 23, 2016 Share Posted November 23, 2016 On 10/9/2016 at 4:38 PM, Mahmud Lee said: same here. it doesn't work with Alfred 3.1 and Sierra I am pretty new to alfred workflows. Can anyone tell me, what this alf2Sear is? Is it an internal handler? Where is it documented? The error seems to appear in this script file: on run argv set wf to load script POSIX file (POSIX path of ((POSIX file ((POSIX path of (path to me)) & "/..") as text) & "workflow.scpt" as text) as text) set wf to wf's new_workflow_with_bundle("com.sztoltz.newfolder") set sArgv to argv as text set someSource to {} if sArgv contains tab then set {TID, text item delimiters} to {text item delimiters, tab} repeat with i from 1 to the number of text items of sArgv set end of someSource to text item i of sArgv end repeat set AppleScript's text item delimiters to TID else set end of someSource to sArgv end if wf's set_value("alf_files", someSource, "settings.plist") tell application "Alfred 3" to «event alf2Sear» "❊ new folder " end run Link to comment
deanishe Posted November 23, 2016 Share Posted November 23, 2016 It looks like the internal name for the Alfred 2 search command. Change it to tell application "Alfred 3" to search "..." Link to comment
lycopodiopsida Posted November 24, 2016 Share Posted November 24, 2016 (edited) 19 hours ago, deanishe said: It looks like the internal name for the Alfred 2 search command. Change it to tell application "Alfred 3" to search "..." Ah, thank you. That's it - the Workflow works again For other readers: You have to change following things to make it working in Alfred 3: 1: in the file workflow.scpt change the numbers marked bold to "3" set my _cache to (my _home) & "/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/" & (my _bundle) & "/" set my _data to (my _home) & "/Library/Application Support/Alfred 3/Workflow Data/" & (my _bundle) & "/" 2: in the file nf_01.scpt change the line tell application "Alfred 2" to «event alf2Sear» "❊ new folder " to tell application "Alfred 3" to search "❊ new folder " Edited November 24, 2016 by lycopodiopsida error in code Link to comment
PurplTentacle Posted December 30, 2016 Share Posted December 30, 2016 On 24.11.2016 at 9:34 AM, lycopodiopsida said: Ah, thank you. That's it - the Workflow works again For other readers: You have to change following things to make it working in Alfred 3: 1: in the file workflow.scpt change the numbers marked bold to "3" set my _cache to (my _home) & "/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/" & (my _bundle) & "/" set my _data to (my _home) & "/Library/Application Support/Alfred 3/Workflow Data/" & (my _bundle) & "/" 2: in the file nf_01.scpt change the line tell application "Alfred 2" to «event alf2Sear» "❊ new folder " to tell application "Alfred 3" to search "❊ new folder " Thanks, I did everything you suggested, but it still does not work for me (Alfred 3.2.1, El Capitan 10.11.6). I get the following message in debug mode, which seems to be odd: [2016-12-30 09:58:38][trigger.action] Processing output of 'action.script' with arg '( "/Users/myuser/Desktop/NeuerOrdner/4.txt", "/Users/myuser/Desktop/NeuerOrdner/5.txt" )' [2016-12-30 09:58:38][ERROR: action.script] 0:169: execution error: Dieses Skript scheint kein AppleScript-Skript zu sein. (-1752) The error-message translated to English means "Script doesn’t seem to belong to AppleScript." Apart from changing things suggested, I did not change anything. Does anyone has an idea? Thanks ... Link to comment
deanishe Posted December 30, 2016 Share Posted December 30, 2016 Did you edit the script in Script Editor? Link to comment
PurplTentacle Posted December 30, 2016 Share Posted December 30, 2016 20 minutes ago, deanishe said: Did you edit the script in Script Editor? No, first I used a plain text editor (Textmate 2 in Apple Script mode). I now changed the script using the script editor, and now it perfectly works (have no idea what the difference is...) Thanks a lot for your help! Link to comment
deanishe Posted December 30, 2016 Share Posted December 30, 2016 .scpt files are compiled scripts, i.e. they're not text files. If you save an AppleScript as text, you should use the .applescript extension, not .scpt Link to comment
PurplTentacle Posted December 30, 2016 Share Posted December 30, 2016 9 hours ago, deanishe said: .scpt files are compiled scripts, i.e. they're not text files. If you save an AppleScript as text, you should use the .applescript extension, not .scpt I did not know that. They appeared to me as normal text files - but that's clear now. Thanks for the explanation, much appreciated! Link to comment
deanishe Posted January 1, 2017 Share Posted January 1, 2017 I guess I phrased that wrong. The .scpt extension is for compiled scripts, .applescript for text files. Otherwise bad things happen. Link to comment
Jasondm007 Posted January 9, 2019 Share Posted January 9, 2019 On 4/20/2013 at 12:11 PM, Carlos-Sz said: David was faster! Anyway, here is my approach considering your suggestion: Right now it works as an Alfred File Action only Select the files in Alfred browser, select “To New Folder” action then one of the 3 options below (move, copy or only create a new folder): Downlaod now @Carlos-Sz Is there any way you could post your workflow again (re: file action to move files to a new folder)? The previous link no longer works. Thanks for your help! Or, of others have an updated version, that'd be great, too. Thanks! JolinM 1 Link to comment
PurplTentacle Posted January 9, 2019 Share Posted January 9, 2019 Can you provide an upload-link? I've dumped my Dropbox-account a long time ago... Link to comment
MrShap Posted March 14, 2019 Share Posted March 14, 2019 Anyone still have this workflow? Can you upload it again? THANKS! Link to comment
lycopodiopsida Posted June 1, 2019 Share Posted June 1, 2019 (edited) @Jasondm007 @PurplTentacle @MrShap Hi, I was absent from Alfred (and this forum) for some time, but I am back. Good news: I still have this workflow. Bad news: it is, of course, broken again and due to Applescript being one of the least readable script languages for me, I struggle to identify the problem. I've changed the folder references for Alfred 4 it it now down to the following error in the file nf_01.scpt: [23:42:36.565] ERROR: To New Folder[Run Script] 0:182: execution error: Can’t make file "Macintosh HD:Users:MY_USER:Library:Application Support:Alfred:Alfred.alfredpreferences:workflows:user.workflow.D95456CA-8699-47DE-AF7B-F94C00EC4EBC:nf_01.scpt:..:workflow.scpt" into type file. (-1700) (ignore the MY_USER, I've removed mine) So, I guess it boils down to the line 3 and the following code part: & "/.." on run argv set wf to load script POSIX file (POSIX path of ((POSIX file ((POSIX path of (path to me)) & "/..") as text) & "workflow.scpt" as text) as text) set wf to wf's new_workflow_with_bundle("com.sztoltz.newfolder") set sArgv to argv as text set someSource to {} if sArgv contains tab then set {TID, text item delimiters} to {text item delimiters, tab} repeat with i from 1 to the number of text items of sArgv set end of someSource to text item i of sArgv end repeat set AppleScript's text item delimiters to TID else set end of someSource to sArgv end if wf's set_value("alf_files", someSource, "settings.plist") tell application "Alfred 4" to search "❊ new folder " end run I don't have a real idea what this syntax does in AS - I can only assume it should call a script file from another script file. Any help on this one? Edited June 1, 2019 by lycopodiopsida Link to comment
lycopodiopsida Posted June 2, 2019 Share Posted June 2, 2019 So, I've fixed this workflow for now... I will try to contact the original author to get his permit to republish it. Until then ping me via private message with your mail, I will send it. Carlos-Sz 1 Link to comment
lycopodiopsida Posted June 2, 2019 Share Posted June 2, 2019 I've posted updated workflow to github with permission from Carlos. Link to repository Direct link to the Workflow file Carlos-Sz and Jasondm007 2 Link to comment
xilopaint Posted June 3, 2019 Share Posted June 3, 2019 (edited) 15 hours ago, lycopodiopsida said: I've posted updated workflow to github with permission from Carlos. Link to repository Direct link to the Workflow file You might want to use .applescript extension rather than .scpt on GitHub as the latter one is for compiled files and can't be read within the repo. Edited June 3, 2019 by xilopaint dfay 1 Link to comment
lycopodiopsida Posted June 3, 2019 Share Posted June 3, 2019 8 hours ago, xilopaint said: You might want to use .applescript extension rather than .scpt on GitHub as the latter one is for compiled files and can't be read within the repo. Done! Link to comment
xilopaint Posted June 3, 2019 Share Posted June 3, 2019 1 hour ago, lycopodiopsida said: Done! Any reason for maintaining the .scpt files? I recommend you don't place compiled and uncompiled versions of the files in the same directory. This is a repository of an AppleScript based workflow for your reference. Link to comment
Jasondm007 Posted June 3, 2019 Share Posted June 3, 2019 Thanks a ton @lycopodiopsida, @Carlos-Sz & @xilopaint!! Link to comment
PurplTentacle Posted June 3, 2019 Share Posted June 3, 2019 Thanks a lot to everyone involved. Great work. @lycopodiopsida, @Carlos-Sz, @xilopaint Link to comment
justnp Posted January 28, 2020 Share Posted January 28, 2020 On 4/20/2013 at 10:45 AM, jdfwarrior said: Quick stab at it.. try this: Download Try that out, let me know what you think and we can try to improve it from there (if needed) Any way you have an active link to this? Would love to play around with it! Thanks Link to comment
fcalazans Posted March 26, 2020 Share Posted March 26, 2020 On 4/20/2013 at 8:11 PM, Carlos-Sz said: David was faster! Anyway, here is my approach considering your suggestion: Right now it works as an Alfred File Action only Select the files in Alfred browser, select “To New Folder” action then one of the 3 options below (move, copy or only create a new folder): Downlaod now I know it was long time ago but, I can't find anything like it. Would it be possible to relink this file actions. I've tryed the whole internet for this. Link to comment
lycopodiopsida Posted March 26, 2020 Share Posted March 26, 2020 2 hours ago, fcalazans said: I know it was long time ago but, I can't find anything like it. Would it be possible to relink this file actions. I've tryed the whole internet for this. Hi, I've uploaded it to github, see my post in this thread: fcalazans 1 Link to comment
JolinM Posted October 13, 2020 Share Posted October 13, 2020 Hi there, I played a bit with some of the workflow here, and they didn’t really did it for me. I created this one, inspired by this Envatotuts. The workflow creates predetermined folders. https://www.dropbox.com/s/q3l16bwzac02fcm/Create folders 0.5.alfredworkflow?dl=0 In this case, it will creates: _archives _ressources Links Export > _archives My issue is that the script will fail if my source folder has spaces in it’s name. Here’s the code: myPath=$(osascript -e 'try' -e 'tell application "Finder"' -e 'set this_folder to (the target of the front window) as alias' -e 'set this_folder to POSIX path of this_folder' -e 'return this_folder' -e 'end tell' -e 'end try' -e 'set this_folder to POSIX path of (path to desktop)' -e 'return this_folder') cd $myPath mkdir _archives mkdir _ressources mkdir Links mkdir Export cd Export mkdir _archives Any thoughts? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now