I've modified the following script in DTPO and as written, I select files in DTPO, run the Alfred Keyword to Applescript workflow I made using the following code. It then auto fills a pop-up box with "archive-", but I still have to press Enter.
Is there a way to press "enter" using Alfred so it's a simple invoke Alfred, type my keyword (using the default text I've added to the script) and have the files all rename with no more user interaction?
-- Add Prefix To Names
-- Created by Christian Grunenberg Sat May 15 2004.
-- Copyright (c) 2004-2009. All rights reserved.
-- Based on (c) 2001 Apple, Inc.
tell application id "com.devon-technologies.thinkpro2"
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
repeat
set prefix to display name editor "Add Prefix" info "Prefix:" default answer "archive-"
if prefix is not "" then exit repeat
end repeat
repeat with this_item in this_selection
set current_name to the name of this_item
set new_item_name to prefix & current_name
set the name of this_item to new_item_name
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell