Applescript result not passing to automator

Joined
Aug 21, 2015
Messages
1
Reaction score
0
I have an automator workflow that takes an image file, and uses the name without the extension to create a folder. The workflow functions properly if I manually add the file in the applescript via dialogue, but won't return the required name if the picture is used as input to the applescript step in the workflow. I have received results that pass the entire path and file name as the new folder name.
The workflow part in question ;
1. Create a folder called 'Destination';
2. Uses the find finder items to get the image in question (this works)
3. Uses the input for an applescript that extracts the name and does the conversion, then
4. passes the result to a text variable.
5. changes the name 'Destination' to the text variable value

the workflow says the applescript (listed below) doesn't return any value. I'm very new at applescript and automator. Any suggestions why I'm having issues?


------- the Run Applescript step in Automator------------
on run {input}
--set this_file to choose file ( this works when I swap the line and the next)
set this_file to input
--set this_file to storage
try
tell
application "Image Events"
-- start the Image Events application
launch
-- open the image file
set this_image to openthis_file
-- set this_image to open image
-- extract the property value
copy the name of this_image to the_name
set thePrefix to text 1 thru ((offsetof "." inthe_name) - 1) of the_name
-- purge the open image data
close
end
tell
return
thePrefix as string
end try
end
run
------ end applescript-----
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,106
Reaction score
497
Hello and welcome.

A few members here have a little experience with Automator and AppleScript. However, it may be best to post this question at the following link, as they have a lot of folks with experience scripting on the Mac:

MacScripter

C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top