IGNORE THIS POST, PLEASE!
I realized that I couldn’t run the work flow saved from the desktop, i needed to save it as an application.
I have an automator script that goes:
- Ask for text
- Run Applescript
- not there yet
- etc
When I get to the actionscript:
on run {input, parameters}
set com to (input as text)
set thecomment to ""
tell application "Finder" to set workingDir to get folder of (path to me) as Unicode text
set theFile to workingDir & "hashtag.txt"
set hashtaglist to paragraphs of (read file theFile)
--choose from list hashtaglist with prompt "Please select #hashtag" OK button name "Select" with multiple selections allowed
-- set choice to result as text
-- if choice = "false" then
-- return
-- end if
-- set d to text item delimiters
-- set text item delimiters to "#"
-- set choice to choice's text items
-- set text item delimiters to " #"
-- tell choice to set choice to item 1 & ({""} & rest)
-- set text item delimiters to d
-- set thecomment to com & return & return & choice
return thecomment
end run
It craps out on me at the set hashtaglist to paragraphs of (read file theFile). When I run the script in the ActionScript editor it works. Providing I have a com variable. How can I open a file in automator inside of an action script and create a list from it. I assumed it would be the same actionscript in both applications, but it is proving not to be so.