RUN AN APPLESCRIPT IN XCODE

Hi guys !


I'm new to Xcode as well as I am to AppleScript 🙂


All I need is to run an AppleScript in an Xcode application


is this possible ?


Bassically, the application is downloading pictures from a url list in Excel and renames the files acording the list in Excel


thanks in advance !


Greetings from Germany !



this is my applescript code :



tell application "Microsoft Excel"


set filenames to value of every cell of range "K3:K200" of sheet "Image_Moves" of document 1


set URLs to value of every cell of range "L3:L200" of sheet "Image_Moves" of document 1


end tell

repeat with i from 1 to count URLs


if (item i of filenames is not missing value) and (item i of URLs is not missing value) then




set thisFname to quoted form of (POSIX path of ({path to desktop, "Image_Moves:"} as text) & item i of filenames)


set thisUrl to quoted form of item i of URLs



set status to (do shell script "curl -s -o " & thisFname & space & thisUrl)



end if


end repeat

try


tell application "Finder"



delete (every item of folder ("Image_Moves") whose name begins with "0")



end tell


on error


display dialog ("Error. Couldn't Move the File") buttons {"OK"}


end try

All I need is to run an AppleScript in an Xcode application

Based on the above I’m going to recommend that you take a look at NSAppleScript. This is a Foundation class that makes it super easy to run AppleScripts from your native app.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you Eskimo for guiding me to the right path.


do you think there's somebody who can really help me turning this into an Mac app ?

What’s the target market for your app? Is this something for yourself? Or something you intend to ship to lots of users?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

target market is up to 5 users max 10 ... so kinda local personal.


the one that we have now it's working, but involves a lot of other application in order to run.... like applescript, keyboard maestro, excel 😟


I'd be super happy if you can help me out.


greetings from germany

DTS only provides technical support, so we can’t help out with this. It sounds like you need to engage a consultant / contractor. I can’t advise you on that front, but my general recommendation is that you engage with your local {mac,i,watch,tv}OS developer group and see if that provides any leads.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
RUN AN APPLESCRIPT IN XCODE
 
 
Q