jhncbrwn Posted June 9, 2013 Share Posted June 9, 2013 I'm trying to write a workflow that takes the selected items in Alfred and moves them to a preset folder. My applescript keeps giving me the error "Can’t get POSIX file" Any suggestions would be appreciated. set filelist to "{query}" set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to "\t" set theArray to every text item of filelist set AppleScript's text item delimiters to oldDelimiters tell application "Finder" repeat with eachitem in theArray set a to POSIX file eachitem set b to POSIX file "Macintosh HD/Users/USERNAME/Desktop/Temp" as text move a to b end repeat end tell Link to comment
Carlos-Sz Posted June 9, 2013 Share Posted June 9, 2013 I'm trying to write a workflow that takes the selected items in Alfred and moves them to a preset folder. My applescript keeps giving me the error "Can’t get POSIX file" Any suggestions would be appreciated. set filelist to "{query}" set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to "\t" set theArray to every text item of filelist set AppleScript's text item delimiters to oldDelimiters tell application "Finder" repeat with eachitem in theArray set a to POSIX file eachitem set b to POSIX file "Macintosh HD/Users/USERNAME/Desktop/Temp" as text move a to b end repeat end tell Try this code: set filelist to “{query}" set text item delimiters to tab set theArray to every text item of filelist set text item delimiters to "" repeat with eachitem in theArray set a to POSIX file (eachitem) set b to POSIX file ("/Users/USERNAME/Desktop/Temp") tell application "Finder" to move a to b end repeat lendenmc 1 Link to comment
jhncbrwn Posted June 9, 2013 Author Share Posted June 9, 2013 Hi Carlos-Sz, This worked! Thank you for your help. Regards, Jhn Link to comment
Carlos-Sz Posted June 10, 2013 Share Posted June 10, 2013 Hi Carlos-Sz, This worked! Thank you for your help. Regards, Jhn Great! 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