Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert AppleScript to Javascript

Status
Not open for further replies.

FidelCastro

Technical User
Sep 13, 2007
2
US
I was wondering if anyone could help me out with this. I don't know anything about Javascript ... yet. The script below was written for AppleScripts and I want to rewrite this for Javascripts ... I hate to just throw out a "hey, do this for me" question, but I'm hoping there might be one or two of you here who are so well versed in both languages that it'd be no big deal to re-write this.

Even if you just point me in the right direction for how I can learn this on my own, I'd be very appreciative.

Here's the AppleScript that I want to convernt to Javascript:

repeat
tell application "Microsoft Excel"
--Activate
set currRow to Row of Selection as string
set currColumn to Column of Selection as string
set theOrder to Formula of Selection as string
end tell
set {text:currRow} to currRow as string
set {text:currColumn} to currColumn as string
set {text:theOrder} to theOrder as string
if theOrder = "" then
activate
display dialog "The script is finished" buttons {"OK"} default button "OK"
return -- stops entire script
end if


(the main part of my script, which is already coded fits in here)


tell application "Microsoft Excel"
--Activate
Select Range ("R" & (currRow + 1) & "C" & currColumn)
set ColorIndex of Interior of Range ("R" & (currRow) & "C" & currColumn) to 17

end tell
 
Are you sure you want JavaScript? Looks to me like this is a macro for Excel and most MicroSoft apps use VBScript as their macro language.

And sorry, I don't know anything about AppleScript (other than it charges you an arm and a leg for the first 2 months and then the price drops to become more accessible).

Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[[]Starbase47.com]
 
Yep, Javascript is what I need. I'm converting my AppleScript (which is what's listed below ... I guess it is similar to the way Macros are written in Excel) to Javascript because the program I'm working with is no longer compatible with AppleScript.

What that script specifically does is this:
Takes an order number from a column of order numbers in excel, and inputs that order number into SAP (the production system I'm using this script with). I have all the script done for what SAP does wiht that order number, I just don't know how to make the script work from a column of order numbers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top