Applescripts copy a file from current working directory to Application\folder1

Joined
Apr 25, 2008
Messages
6
Reaction score
0
Points
1
Hi All,

I'm trying to copy a file "ConfigUDPrint.app" from "current working directory" to Applications/UNiFLOW

So far I have the following script:
//////////////////////////////////////////
tell application "Finder"
set myFolder to (quoted form of (POSIX path of (parent of (path to me) as string)))

do shell script "mkdir -p '/Applications/UniFLOW'"
do shell script "cd $(dirname $(realpath $0))"
do shell script "cd $myFolder"
do shell script "cp -R ConfigUDPrint.app '/Applications/UNiFLOW'"

end tell

//////////////////////////////////////



Any help would be nice.

Thanks,
 
Joined
Aug 13, 2011
Messages
200
Reaction score
7
Points
18
Location
West Sussex
When you say "current working directory", what do you mean ?

do you mean the current selected folder in Finder, or the current directory in the command shell ?

The reason I ask is that the AppleScript command "path to me", will return the path to the Applescript itself, or the path to the AppleScript application.

Regards Mark
 
OP
C
Joined
Apr 25, 2008
Messages
6
Reaction score
0
Points
1
Hi Mark,

Sorry to get back to you so late..
Here is the scenario:

I have an installer zip folder, let's call it "Installer.zip"
Users will download the Installer.zip folder from internet "Box or any could storage.."
the expand it.
Within the expand Installer folder, there are install.app and driver.pkg files.
When users run install.app it will execute the driver.pkg within the same folder.

my question is :
what is a shell script to cd to a current working folder?

Please let me know,

Thx-Ebi
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top