Please help me remove the last elements of shell script from my applescript
I read somewhere that running a shell script in an applescript was inefficient and created extra overhead, fine, so I am trying to take all of my shell script out of my applescript (this should fix issues with forward slashes in names as well...)
however I am stuck on these last two lines (I know they are probably trivial but I've been up waaaay too long now) so I was wondering if anyone would be awesome enough to show me how to convert the bash to applescript.
--does a recursive copy and rename
do shell script "cp -R " & (thePath as text) & " " & (theOtherPathWithFile as text)
--does a copy and rename, then a simple move
do shell script "cp " & (quoted form of (POSIX path of this_item as text)) & " " & (theNewPath as text) & "&& mv " & (theOtherPathWithFile as text) & " ~/Desktop"
Any and all help will be appreciated.
There isn't anything wrong with using shell scripts, especially since AppleScript is designed to do this very thing. There is some overhead when using do shell script, just as there is some overhead when using an application tell statement, so it just depends on what you are doing.
The performance of any particular script would also be up to whatever is acceptable to you (or your customers), and sometimes a shell script is the most efficient way to do something. Many of the system utilities are just GUI front-ends to a shell script, so they can't be all bad.
To do your file copy or move with the Finder, you will need to tell it to duplicate or move the item(s) (there is that pesky overhead again). Shell scripts use POSIX paths while the Finder uses colons as its path delimiter, so you will need to use the correct file path references - there is a decent article about that at Satimage. Once your file paths have been defined (or using something like choose file or choose folder)), your script would be something like:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #DAFFB6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Finder"
duplicate source to destination
-- move source to destination
end tell
</pre>
See the Finder and *System Events* scripting dictionaries for more information about the ways they deal with files.
Similar Messages
-
Remove the last chr(13) & chr(10) from a string
Hello, all.
I'm trying to get confirmation files to upload to Amazon for their "Charge When Ship" program. I've got the file creating as it should be with one minor exception.
I'm setting a variable, giving it the header column information and ending that with chr(13) & chr(10); then I'm looping through a query to add the information, each iteration tacks chr(13) & chr(10) to the end of it; then I'm taking that variable and writing the data to a file using CFFILE.
But I think that the last chr(13) & chr(10) is causing Amazon servers to think there's one more line of information than there really is, and it's erroring.
Can anyone tell me how to remove that last chr(13) & chr(10) from the variable before writing it to file?
Thanks,
^_^giving it the header column information and ending that with chr(13) & chr(10); then I'm looping through a query to add the information, each iteration tacks chr(13) & chr(10) to the end of it; then I'm taking that variable and writing the data to a file using CFFILE.
Trim() the variable or change the code so it does not generate an extra new line.
Since your content has a header, place the new line characters at the beginining of each query iteration.
#headerColumnsHere# <!--- notice there is no new line after the column header information --->
<cfouput query="yourQuery">#chr(13)##chr(10)# #ColumnA##ColumnB#...etcetera...</cfoutput> -
firefox is preventing me from opening an email from someone I have been exchanging emails with. says might be due to pop up restriction. Please remove pop up restriction so I can open up email.
thanksThe Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
To Reset Firefox do the following:
#Go to Firefox > Help > Troubleshooting Information.
#Click the "Reset Firefox" button.
#Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
#Firefox will open with all factory defaults applied.
Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
Did this fix your problems? Please report back to us! -
Please help me update the vi from 5.1 to 8.6
please help me update the vi and its sub vi from 5.1 to 8.6 . thanks very much
Attachments:
NI-DSA Swept Sine Audio Tester13.llb 498 KBattached
Attachments:
NI-DSA Swept Sine Audio Tester13.llb 131 KB -
My itunes looks nothing like the examples in this tutorial. I do not have "display exact duplicates" or "date added". Can someone please help me remove duplicate songs? Also, I downloaded two audio books and they are showing up in my song list. Why???
'Show duplicates' is now under the 'View' menu. To see the 'Date added' column go to 'View options' from the 'View' menu and check it in the section under 'Stats'.
Click an audiobook once to select it and hit command-i (Mac) or control-i (Windows). Go to the 'Options' tab and set 'Media Kind' to 'Audiobook'. -
How to remove only the last element of spreadsheet string
I use path to string option to store image path into database and while retrieving the string is again converted into path but it gives out an error as the output of array to spreadsheet string gives out a tab at the end which is unable for the IMAQ read file to recognise.but when i use the path of the image directly into IMAQ readfile the image is opened . so how to remove the tab only at the end of output of the spreadsheet string(whose length can vary)? I have also attached my program with this.
Attachments:
retrieve_images_from_DB.vi 65 KB
file_path_to_db_(images).vi 40 KB
create_table_for_images.vi 45 KBindhu wrote:
> Thanks for your reply!
> But my problem is to remove only the last element(which is a tab or an
> alphabet) from a spreadsheet string of any length.
If you just want to remove the last character of a string just use the
String Size function reduce the result by one and wire it together with
the string to the Split String function.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
My iPhone 4s is locked in speaker mode where it tells me every time I touch a new app and it outlines the app I touch and requires me to touch the screen twice in order to advance. Please help me remove this setting
Explore Settings > General > Accessibility. Around page 128 of the User Guide is probably appropriate.
The User Guide is available at http://support.apple.com/manuals/ or downloadable from iTunes as an iBook. -
I need help to remove the wrong email on my Iphone. the represnter who set up my phone put in the wrong email, and now I can't down loand apps on my phone because the apple ID does not match
So sign out of the Apple ID under Settings > iTunes & App Store, then sign in with your own.
-
Why does iMovie remove the last half of my imported clips?
I've noticed that when I'm importing clips from an SD card the window tells me "___ minutes and ___ seconds have been imported from ___ clips." but when I go to view said footage, only the first half of the each clip is there. Literally to the second, iMovie stops at exactly the halfway point of the clip and just completely removes the last half. What's going on? Please help.
I've noticed that when I'm importing clips from an SD card the window tells me "___ minutes and ___ seconds have been imported from ___ clips." but when I go to view said footage, only the first half of the each clip is there. Literally to the second, iMovie stops at exactly the halfway point of the clip and just completely removes the last half. What's going on? Please help.
-
Strange directory link, please help to remove it, thanks.
Hi All,
Today, I find two directory with the same inode number.
It is very strange, as I know that solaris 9 can't make hard link to a directory.
Could you please help to remove one of these two directory?
Thanks in advance!
# ls -lid qa_ftp
48248350 drwxrwxrw-+ 35 root qa4adm 1024 Jul 18 22:27 qa_ftp
# ls -lid ../QA
48248350 drwxrwxrw-+ 35 root qa4adm 1024 Jul 18 22:27 ../QA
# cat /etc/release
Solaris 9 4/03 s9s_u3wos_08 SPARC
Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 25 February 2003
#There's another possibility, the "-L" option to ls(1) causes ls to follow symbolic links. I suspect someone has aliased ls to "ls -L" and that would give the results you see. try giving a full path to ls, ie "/bin/ls -lid qa_ftp ../QA" and see if that gives the same result.
HTH,
Roger S. -
CAN SOMEONE PLEASE HELP ME REMOVE ITUNES SO I CAN RE INSTALL IT!
How Can I Remove and Unistall Itunes From My Computer I Went To "Add or Remove Programs" and Clicked Itunes "Change/Remove" and nothing happen! its still there same thing for quicktime and im trying to unistalled them because i dont have any were in my computer to click itunes to open! so its like i dont even have it but i cant download it till i remove that one on the add or remove program section but i cant because nothing happens CAN SOMEONE PLEASE HELP ME REMOVE ITUNES! FROM THAT LIST!
Well, you can do what I did. You can click onto "Start" and then "My Computer". From there, click onto Hard Disc Drive "C". A window will open that shows the folders that are present. Click onto "Program Files" and then another window will open. You should see both I-Tunes and Quicktime there. Right click onto each one and then click "Delete". That should work. When it's done, restart your computer.
If it doesn't work, hit the "control/alt/delete" keys at the same time and select "Processes". If they show up there, delete them from that list first and then repeat the above procedure.
Good luck. By the way, check out my post on "People with Problems, Read here". You'll find that there's many of us here that cannot make our I-Pod's work correctly because the software for them is HORRIBLE! -
When I download the digital copy of the Hunger Games, it stops at 4.0GB and first returns an error code -1309 and then the code -50. Please help me complete the download. I have tried removing the .tmp folder and downloading it again, but each time it stops the download in the same place.
I discovered the solution. The external drive I was saving it to was formatted as FAT32. In that format, the largest files can only be 4GB, which explains why it kept stopping at 4GB. I backed up all the files then reformatted it as Mac OS Extended (Journaled), this is possible since I am on an iMac.
-
Can somebody please tell me what 'genius' included 'family' in reminders, and, made it so i cannot remove it. I have NO family, and, i find this particularly hurtful and disrespectful. Can somebody please help me remove it.
Hi EmmeElle,
Is it an iCloud reminder or a third party reminder like from an Exchange account(maybe your company provides this service together with mail etc..).
In the first case you should definitely be able to delete it by right click->delete or via https://www.icloud.com
In the second case there might be a browser based settings page from your company or the provider of the service (i.e. Exchange) itself. Otherwise you can go to your System Preferences -> Internet Accounts and deactivate reminders for this account. WARNING: this also deletes all other reminder lists and reminders from this service on your mac.
jl -
Please add exit to the last line of the sql script
Hi,
I am executing a sql script from UNIX shell. When I execute it at the command prompt the script executes successfully, but when I schedule the script on cron, the script is throwing an error with the above message
"Please add exit to the last line of the sql script"
Any idea what is happening? Thanks in advance for any help
thedbaIt works check this out..
<< script a.sh >>
logfile=/home/oracle/sri/x.log
sqlplus -s /nolog <<DOC >> ${logfile}
whenever sqlerror exit sql.sqlcode
connect scott/tiger
@a.sql a.log
DOC
<< script a.sql >>
set feedback off
set echo off
spool &1
select * from tab where tname like 'A%';
spool off
exit;
<< a.log >>
TNAME TABTYPE CLUSTERID
AQ$DEF$_AQCALL VIEW
AQ$DEF$_AQERROR VIEW
AQ$_DEF$_AQCALL_F VIEW
AQ$_DEF$_AQERROR_F VIEW
AQ$_INTERNET_AGENTS TABLE
AQ$_INTERNET_AGENT_PRIVS TABLE
AQ$_QUEUES TABLE
AQ$_QUEUE_TABLES TABLE
AQ$_SCHEDULES TABLE
<< x.log >>
TNAME TABTYPE CLUSTERID
AQ$DEF$_AQCALL VIEW
AQ$DEF$_AQERROR VIEW
AQ$_DEF$_AQCALL_F VIEW
AQ$_DEF$_AQERROR_F VIEW
AQ$_INTERNET_AGENTS TABLE
AQ$_INTERNET_AGENT_PRIVS TABLE
AQ$_QUEUES TABLE
AQ$_QUEUE_TABLES TABLE
AQ$_SCHEDULES TABLE-Sri -
Please help me, I just bought elements and premiere 13 but I have a MAC and somehow I bought Windows !! HELP
You can request that we swap out your serial numbers with ones that will work for mac.
The following guide should get you going:
Order product | Platform, language swap
Maybe you are looking for
-
Any suggestions?
-
Linking errors when using ibsta
Hello, I have been trying to write C code to automate a Keithley 2410 through GPIB. I am using Windows XP 32-bit, and VC++. I believe I was successful in getting a handle to the gpib-32.dll. However, I am getting a linking error when I try to use ib
-
XSL transformation never works on Websphere 5
I'm doing a xsl transformation on websphere 5 and this xsl never finds the right values. When I run the exact same transformation with the same source, it finds all the values, but on the server it just return empty tags. Why? And how do I fix this?
-
Fonts are messed up in different ways
I had a hard time getting my fonts to look right last night after publishing my site. After publishing, the fonts which I had placed on my page, were all over the page, just spread all over at random, not where I put them. Some fonts were also not th
-
It's not letting me play my songs in itunes. They are all listed but will not play
Why will itunes not let me play my songs? I see all my purchases listed in gray but it will not let me look at them or play them from my music.