Jump to content
roza

create new folder

Recommended Posts

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

Share this post


Link to post
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

 

Share this post


Link to post
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 by lycopodiopsida
error in code

Share this post


Link to post
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 ...

 

Share this post


Link to post
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!

Share this post


Link to post
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!

Share this post


Link to post
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):

tnf_01.png

 

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!

Share this post


Link to post
Posted (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 by lycopodiopsida

Share this post


Link to post

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.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...